Build optimization (#2591)

This commit is contained in:
Grzegorz Piwowarek
2017-09-09 16:55:05 +02:00
committed by GitHub
parent 4589860efb
commit f01d1e257e
9 changed files with 148 additions and 58 deletions

View File

@@ -1,10 +1,5 @@
package org.baeldung.web.service;
import static io.restassured.RestAssured.given;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsCollectionContaining.hasItems;
import static org.hamcrest.core.IsEqual.equalTo;
import org.apache.commons.lang3.RandomStringUtils;
import org.baeldung.web.main.Application;
import org.junit.Test;
@@ -13,6 +8,11 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;
import static io.restassured.RestAssured.given;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsCollectionContaining.hasItems;
import static org.hamcrest.core.IsEqual.equalTo;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT)
public class StudentServiceIntegrationTest {
@@ -21,7 +21,8 @@ public class StudentServiceIntegrationTest {
@Test
public void givenRequestForStudents_whenPageIsOne_expectContainsNames() {
given().params("page", "0", "size", "2").get(ENDPOINT).then().assertThat().body("content.name", hasItems("Bryan", "Ben"));
given().params("page", "0", "size", "2").get(ENDPOINT).then().assertThat()
.body("content.name", hasItems("Bryan", "Ben"));
}
@Test
@@ -58,5 +59,4 @@ public class StudentServiceIntegrationTest {
public void givenResourcesExist_whenFirstPageIsRetrieved_thenPageContainsResources() {
given().params("page", "0", "size", "2").get(ENDPOINT).then().assertThat().body("first", equalTo(true));
}
}