Skip to content

Commit e687bd8

Browse files
committed
temp
1 parent e341d92 commit e687bd8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/main/java/io/visual_regression_tracker/sdk_java/VisualRegressionTracker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ void startBuild() throws IOException {
4343
BuildResponse buildDTO = new Gson().fromJson(responseBody.string(), BuildResponse.class);
4444
this.buildId = buildDTO.getId();
4545
this.projectId = buildDTO.getProjectId();
46+
} catch(Exception ex){
47+
System.out.println(ex.getMessage());
48+
throw ex;
4649
}
4750
}
4851
}

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,21 @@ void shouldStartBuild() throws IOException, InterruptedException {
7070
MatcherAssert.assertThat(vrt.projectId, CoreMatchers.is(projectId));
7171
}
7272

73+
@Test
74+
void shouldThrowExceptionIfProjectNotFound() throws IOException, InterruptedException {
75+
String projectId = "non-existing";
76+
BuildRequest buildRequest = BuildRequest.builder()
77+
.branchName(this.config.branchName)
78+
.project(this.config.project)
79+
.build();
80+
server.enqueue(new MockResponse()
81+
.setHttp2ErrorCode(404)
82+
.setBody("{\r\n \"statusCode\": 404,\r\n \"message\": \"Project not found\"\r\n}"));
83+
84+
vrt.startBuild();
85+
86+
}
87+
7388
@Test
7489
void shouldSubmitTestRun() throws IOException, InterruptedException {
7590
String buildId = "123123";

0 commit comments

Comments
 (0)