File tree Expand file tree Collapse file tree
src/test/java/com/baeldung/mock/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 </dependency >
3838
3939 </dependencies >
40+ <build >
41+ <plugins >
42+ <plugin >
43+ <artifactId >maven-surefire-plugin</artifactId >
44+ <version >2.20</version >
45+ <configuration >
46+ <excludes >
47+ <exclude >**/**LiveTest.java</exclude >
48+ </excludes >
49+ </configuration >
50+ </plugin >
51+ </plugins >
4052
53+ </build >
4154</project >
Original file line number Diff line number Diff line change 55import org .apache .http .client .methods .HttpPost ;
66import org .apache .http .entity .StringEntity ;
77import org .apache .http .impl .client .HttpClientBuilder ;
8- import org .junit .After ;
9- import org .junit .Before ;
10- import org .junit .Test ;
8+ import org .junit .*;
119import org .mockserver .client .server .MockServerClient ;
1210import org .mockserver .integration .ClientAndProxy ;
1311import org .mockserver .integration .ClientAndServer ;
2826import static org .mockserver .model .HttpResponse .response ;
2927import static org .mockserver .model .StringBody .exact ;
3028
31- public class TestMockServer {
29+ public class MockServerLiveTest {
3230
33- private ClientAndProxy proxy ;
34- private ClientAndServer mockServer ;
31+ private static ClientAndProxy proxy ;
32+ private static ClientAndServer mockServer ;
3533
36- @ Before
37- public void startProxy () {
34+ @ BeforeClass
35+ public static void startProxy () {
3836 mockServer = startClientAndServer (1080 );
3937 proxy = startClientAndProxy (1090 );
4038 }
@@ -170,8 +168,8 @@ private void createExpectationForCallBack(){
170168 );
171169 }
172170
173- @ After
174- public void stopProxy () {
171+ @ AfterClass
172+ public static void stopProxy () {
175173 proxy .stop ();
176174 mockServer .stop ();
177175 }
You can’t perform that action at this time.
0 commit comments