diff --git a/spring-rest-angular/pom.xml b/spring-rest-angular/pom.xml index ce496df742..e838e2d5e6 100644 --- a/spring-rest-angular/pom.xml +++ b/spring-rest-angular/pom.xml @@ -11,7 +11,7 @@ org.springframework.boot spring-boot-starter-parent - 1.3.3.RELEASE + 1.4.2.RELEASE @@ -45,7 +45,7 @@ org.apache.commons commons-lang3 - 3.3 + ${commons-lang3.version} com.google.guava @@ -60,15 +60,20 @@ io.rest-assured rest-assured - 3.0.0 + ${rest-assured.version} test io.rest-assured spring-mock-mvc - 3.0.0 + ${rest-assured.version} test + + org.springframework.boot + spring-boot-starter-test + test + @@ -142,6 +147,8 @@ 19.0 + 3.5 + 3.0.1 diff --git a/spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java b/spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java index 6ad80e5caf..48c985fb9d 100644 --- a/spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java +++ b/spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java @@ -1,26 +1,23 @@ 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; import org.junit.runner.RunWith; -import org.springframework.boot.test.IntegrationTest; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.springframework.test.context.web.WebAppConfiguration; +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.*; -import static org.hamcrest.core.IsCollectionContaining.*; -import static org.hamcrest.core.Is.*; -import static org.hamcrest.core.IsEqual.*; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = Application.class) -@WebAppConfiguration -@IntegrationTest("server.port:8888") +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT) public class StudentServiceIntegrationTest { - private static final String ENDPOINT = "http://localhost:8888/student/get"; + private static final String ENDPOINT = "http://localhost:8080/student/get"; @Test public void givenRequestForStudents_whenPageIsOne_expectContainsNames() {