@@ -136,13 +136,20 @@ public void presentAccountTest() throws Exception {
136
136
assertThat (stubCloudBuildService .findUnmatchedRequests ().getRequests ()).isEmpty ();
137
137
}
138
138
139
+ @ Test
139
140
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" )));
146
153
String buildResponse = objectMapper .writeValueAsString (buildResponse ());
147
154
String operationResponse = objectMapper .writeValueAsString (operationResponse ());
148
155
stubCloudBuildService .stubFor (
@@ -157,7 +164,7 @@ public void presentAccountTestWithPoolOption() throws Exception {
157
164
post ("/gcb/builds/create/gcb-account" )
158
165
.accept (MediaType .APPLICATION_JSON )
159
166
.contentType (MediaType .APPLICATION_JSON )
160
- .content (buildRequest ))
167
+ .content (buildRequestString ))
161
168
.andExpect (status ().is (200 ))
162
169
.andExpect (content ().json (buildResponse ));
163
170
0 commit comments