1212import org .hamcrest .CoreMatchers ;
1313import org .hamcrest .MatcherAssert ;
1414import org .mockito .Mockito ;
15- import org .testng .annotations .AfterTest ;
16- import org .testng .annotations .BeforeTest ;
15+ import org .testng .annotations .AfterMethod ;
16+ import org .testng .annotations .BeforeMethod ;
1717import org .testng .annotations .DataProvider ;
1818import org .testng .annotations .Test ;
1919
@@ -24,14 +24,14 @@ public class VisualRegressionTrackerTest {
2424 MockWebServer server ;
2525 VisualRegressionTracker vrt ;
2626 VisualRegressionTrackerConfig config = new VisualRegressionTrackerConfig (
27- "http://localhost:4200 " ,
27+ "http://localhost" ,
2828 "733c148e-ef70-4e6d-9ae5-ab22263697cc" ,
2929 "XHGDZDFD3GMJDNM87JKEMP0JS1G5" ,
3030 "develop"
3131 );
3232
3333 @ SneakyThrows
34- @ BeforeTest
34+ @ BeforeMethod
3535 void setup () {
3636 server = new MockWebServer ();
3737 server .start ();
@@ -42,7 +42,7 @@ void setup() {
4242 }
4343
4444 @ SneakyThrows
45- @ AfterTest
45+ @ AfterMethod
4646 void tearDown () {
4747 server .shutdown ();
4848 }
@@ -59,7 +59,9 @@ void shouldStartBuild() throws IOException, InterruptedException {
5959 .id (buildId )
6060 .projectId (projectId )
6161 .build ();
62- server .enqueue (new MockResponse ().setBody (gson .toJson (buildResponse )));
62+ server .enqueue (new MockResponse ()
63+ .setResponseCode (200 )
64+ .setBody (gson .toJson (buildResponse )));
6365
6466 vrt .startBuild ();
6567
@@ -130,6 +132,7 @@ void shouldSubmitTestRun() throws IOException, InterruptedException {
130132 .build ();
131133 server .enqueue (new MockResponse ().setBody (gson .toJson (testRunResponse )));
132134 vrt .buildId = buildId ;
135+ vrt .projectId = projectId ;
133136
134137 TestRunResponse result = vrt .submitTestRun (name , imageBase64 , testRunOptions );
135138
0 commit comments