Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/test/java/ci/controller/CiWebhookIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ void successfulBuild_postsPendingThenSuccess() throws Exception {
* iff all checks within the runBuild function pass, updates the status 200 "success".
*/

// Create the repo so it passes checks
Files.createDirectories(temp.resolve(REPO_ID));

// sets value repoParentDir in ciService to temp
// Set value repoParentDir in ciService to temp
ReflectionTestUtils.setField(ciService, "repoParentDir", temp.toString());

// Create the repo so it passes checks
String sha = "0123456789abcdef0123456789abcdef01234567";
Files.createDirectories(temp.resolve("test").resolve(sha).resolve(REPO_ID));

// Fake compilation success - when the compile function is caled always return success as true
CompilationService compilationMock = mock(CompilationService.class);
when(compilationMock.compile(any()))
Expand Down Expand Up @@ -179,7 +180,6 @@ void successfulBuild_postsPendingThenSuccess() throws Exception {
})) {

// Building the fake payload
String sha = "0123456789abcdef0123456789abcdef01234567";
byte[] payloadBody = buildPayload(sha);
String sig = "sha256=" + computeHMACWithSHA256(SECRET, payloadBody);

Expand Down Expand Up @@ -209,12 +209,13 @@ void failedBuild_postsPendingThenFailure() throws Exception {
* iff all the build fails, updates the status to "failure".
*/

// Create the repo so it passes checks
Files.createDirectories(temp.resolve(REPO_ID));

// sets value repoParentDir in ciService to temp
// Set value repoParentDir in ciService to temp
ReflectionTestUtils.setField(ciService, "repoParentDir", temp.toString());

// Create the repo so it passes checks
String sha = "0123456789abcdef0123456789abcdef01234567";
Files.createDirectories(temp.resolve("test").resolve(sha).resolve(REPO_ID));

// Fake compilation success - when the compile function is caled always return success as true
CompilationService compilationMock = mock(CompilationService.class);
when(compilationMock.compile(any()))
Expand Down Expand Up @@ -244,7 +245,6 @@ void failedBuild_postsPendingThenFailure() throws Exception {
})) {

// Building the fake payload
String sha = "0123456789abcdef0123456789abcdef01234567";
byte[] payloadBody = buildPayload(sha);
String sig = "sha256=" + computeHMACWithSHA256(SECRET, payloadBody);

Expand Down