Skip to content

Commit de7c1b3

Browse files
committed
upgrade and cleanup
1 parent 628011b commit de7c1b3

2 files changed

Lines changed: 22 additions & 18 deletions

File tree

‎spring-rest-angular/pom.xml‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>org.springframework.boot</groupId>
1313
<artifactId>spring-boot-starter-parent</artifactId>
14-
<version>1.3.3.RELEASE</version>
14+
<version>1.4.2.RELEASE</version>
1515
</parent>
1616

1717
<dependencies>
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>org.apache.commons</groupId>
4747
<artifactId>commons-lang3</artifactId>
48-
<version>3.3</version>
48+
<version>${commons-lang3.version}</version>
4949
</dependency>
5050
<dependency>
5151
<groupId>com.google.guava</groupId>
@@ -60,15 +60,20 @@
6060
<dependency>
6161
<groupId>io.rest-assured</groupId>
6262
<artifactId>rest-assured</artifactId>
63-
<version>3.0.0</version>
63+
<version>${rest-assured.version}</version>
6464
<scope>test</scope>
6565
</dependency>
6666
<dependency>
6767
<groupId>io.rest-assured</groupId>
6868
<artifactId>spring-mock-mvc</artifactId>
69-
<version>3.0.0</version>
69+
<version>${rest-assured.version}</version>
7070
<scope>test</scope>
7171
</dependency>
72+
<dependency>
73+
<groupId>org.springframework.boot</groupId>
74+
<artifactId>spring-boot-starter-test</artifactId>
75+
<scope>test</scope>
76+
</dependency>
7277
</dependencies>
7378

7479
<build>
@@ -142,6 +147,8 @@
142147

143148
<properties>
144149
<guava.version>19.0</guava.version>
150+
<commons-lang3.version>3.5</commons-lang3.version>
151+
<rest-assured.version>3.0.1</rest-assured.version>
145152
</properties>
146153

147154
</project>

‎spring-rest-angular/src/test/java/org/baeldung/web/service/StudentServiceIntegrationTest.java‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
package org.baeldung.web.service;
22

3+
import static io.restassured.RestAssured.given;
4+
import static org.hamcrest.core.Is.is;
5+
import static org.hamcrest.core.IsCollectionContaining.hasItems;
6+
import static org.hamcrest.core.IsEqual.equalTo;
7+
38
import org.apache.commons.lang3.RandomStringUtils;
49
import org.baeldung.web.main.Application;
510
import org.junit.Test;
611
import org.junit.runner.RunWith;
7-
import org.springframework.boot.test.IntegrationTest;
8-
import org.springframework.boot.test.SpringApplicationConfiguration;
9-
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
10-
import org.springframework.test.context.web.WebAppConfiguration;
11-
12-
import static io.restassured.RestAssured.*;
13-
import static org.hamcrest.core.IsCollectionContaining.*;
14-
import static org.hamcrest.core.Is.*;
15-
import static org.hamcrest.core.IsEqual.*;
12+
import org.springframework.boot.test.context.SpringBootTest;
13+
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
14+
import org.springframework.test.context.junit4.SpringRunner;
1615

17-
@RunWith(SpringJUnit4ClassRunner.class)
18-
@SpringApplicationConfiguration(classes = Application.class)
19-
@WebAppConfiguration
20-
@IntegrationTest("server.port:8888")
16+
@RunWith(SpringRunner.class)
17+
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT)
2118
public class StudentServiceIntegrationTest {
2219

23-
private static final String ENDPOINT = "http://localhost:8888/student/get";
20+
private static final String ENDPOINT = "http://localhost:8080/student/get";
2421

2522
@Test
2623
public void givenRequestForStudents_whenPageIsOne_expectContainsNames() {

0 commit comments

Comments
 (0)