File tree 1 file changed +6
-9
lines changed
src/test/java/org/template/functional
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
1
package org .template .functional ;
2
2
3
- import org .template .Application ;
4
3
import com .jayway .restassured .RestAssured ;
5
4
import org .junit .Before ;
6
5
import org .junit .runner .RunWith ;
7
6
import org .springframework .boot .test .context .SpringBootTest ;
8
- import org .springframework .test . context . ActiveProfiles ;
7
+ import org .springframework .boot . web . server . LocalServerPort ;
9
8
import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
10
- import org .springframework . test . context . web . WebAppConfiguration ;
9
+ import org .template . Application ;
11
10
12
11
13
- //TODO: fix this configuration so that application starts up correctly
14
- //Functional tests will currently run but you need to start the app separately
15
12
@ RunWith (SpringJUnit4ClassRunner .class )
16
- @ SpringBootTest (classes = { Application .class })
17
- @ ActiveProfiles ("test" )
18
- @ WebAppConfiguration
13
+ @ SpringBootTest (classes = { Application .class }, webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT )
19
14
public abstract class TemplateServiceFunctionalTestBase {
20
15
16
+ @ LocalServerPort private Integer port ;
17
+
21
18
@ Before
22
19
public void setUp () {
23
- RestAssured .port = 8080 ;
20
+ RestAssured .port = port ;
24
21
}
25
22
}
You can’t perform that action at this time.
0 commit comments