Skip to content

Commit

Permalink
fix(test): Fixed missing annotation on a test (spinnaker#1302)
Browse files Browse the repository at this point in the history
* fix(test): Fixed missing annotation on a test

* fix(test): Fixed test
  • Loading branch information
jasonmcintosh authored Jan 16, 2025
1 parent 9dbe94d commit 9d0fbd2
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,20 @@ public void presentAccountTest() throws Exception {
assertThat(stubCloudBuildService.findUnmatchedRequests().getRequests()).isEmpty();
}

@Test
public void presentAccountTestWithPoolOption() throws Exception {
PoolOption poolOption = new PoolOption();
poolOption.setName(
"projects/spinnaker-gcb-test-2/locations/gcb-location/workerPools/test-pool");
BuildOptions buildOptions = new BuildOptions().setPool(poolOption);
String buildRequest = objectMapper.writeValueAsString(buildRequest().setOptions(buildOptions));
String taggedBuild = objectMapper.writeValueAsString(taggedBuild());
Build buildRequest =
buildRequest()
.setOptions(
new BuildOptions()
.setPool(
new PoolOption()
.setName(
"projects/spinnaker-gcb-test-2/locations/gcb-locations/workerPools/test-pool")));
String buildRequestString = objectMapper.writeValueAsString(buildRequest);
String taggedBuild =
objectMapper.writeValueAsString(
buildRequest.setTags(Collections.singletonList("started-by.spinnaker.io")));
String buildResponse = objectMapper.writeValueAsString(buildResponse());
String operationResponse = objectMapper.writeValueAsString(operationResponse());
stubCloudBuildService.stubFor(
Expand All @@ -157,7 +164,7 @@ public void presentAccountTestWithPoolOption() throws Exception {
post("/gcb/builds/create/gcb-account")
.accept(MediaType.APPLICATION_JSON)
.contentType(MediaType.APPLICATION_JSON)
.content(buildRequest))
.content(buildRequestString))
.andExpect(status().is(200))
.andExpect(content().json(buildResponse));

Expand Down

0 comments on commit 9d0fbd2

Please sign in to comment.