Skip to content

Commit 9d0fbd2

Browse files
fix(test): Fixed missing annotation on a test (#1302)
* fix(test): Fixed missing annotation on a test * fix(test): Fixed test
1 parent 9dbe94d commit 9d0fbd2

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

igor-web/src/test/groovy/com/netflix/spinnaker/igor/gcb/GoogleCloudBuildTest.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,20 @@ public void presentAccountTest() throws Exception {
136136
assertThat(stubCloudBuildService.findUnmatchedRequests().getRequests()).isEmpty();
137137
}
138138

139+
@Test
139140
public void presentAccountTestWithPoolOption() throws Exception {
140-
PoolOption poolOption = new PoolOption();
141-
poolOption.setName(
142-
"projects/spinnaker-gcb-test-2/locations/gcb-location/workerPools/test-pool");
143-
BuildOptions buildOptions = new BuildOptions().setPool(poolOption);
144-
String buildRequest = objectMapper.writeValueAsString(buildRequest().setOptions(buildOptions));
145-
String taggedBuild = objectMapper.writeValueAsString(taggedBuild());
141+
Build buildRequest =
142+
buildRequest()
143+
.setOptions(
144+
new BuildOptions()
145+
.setPool(
146+
new PoolOption()
147+
.setName(
148+
"projects/spinnaker-gcb-test-2/locations/gcb-locations/workerPools/test-pool")));
149+
String buildRequestString = objectMapper.writeValueAsString(buildRequest);
150+
String taggedBuild =
151+
objectMapper.writeValueAsString(
152+
buildRequest.setTags(Collections.singletonList("started-by.spinnaker.io")));
146153
String buildResponse = objectMapper.writeValueAsString(buildResponse());
147154
String operationResponse = objectMapper.writeValueAsString(operationResponse());
148155
stubCloudBuildService.stubFor(
@@ -157,7 +164,7 @@ public void presentAccountTestWithPoolOption() throws Exception {
157164
post("/gcb/builds/create/gcb-account")
158165
.accept(MediaType.APPLICATION_JSON)
159166
.contentType(MediaType.APPLICATION_JSON)
160-
.content(buildRequest))
167+
.content(buildRequestString))
161168
.andExpect(status().is(200))
162169
.andExpect(content().json(buildResponse));
163170

0 commit comments

Comments
 (0)