Skip to content

Commit d42335b

Browse files
committed
fixed
1 parent 2d839c9 commit d42335b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/test/java/io/visual_regression_tracker/sdk_java/VisualRegressionTrackerTest.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import org.hamcrest.CoreMatchers;
1313
import org.hamcrest.MatcherAssert;
1414
import 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;
1717
import org.testng.annotations.DataProvider;
1818
import 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

Comments
 (0)