|
23 | 23 | import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
|
24 | 24 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
25 | 25 | import static org.junit.jupiter.api.Assertions.assertIterableEquals;
|
26 |
| -import static org.junit.jupiter.api.Assertions.assertThrows; |
27 | 26 | import static org.mockito.ArgumentMatchers.anyString;
|
28 | 27 |
|
29 | 28 | import com.fasterxml.jackson.core.JsonProcessingException;
|
|
32 | 31 | import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
|
33 | 32 | import com.netflix.spinnaker.clouddriver.docker.registry.api.v2.auth.DockerBearerToken;
|
34 | 33 | import com.netflix.spinnaker.clouddriver.docker.registry.api.v2.auth.DockerBearerTokenService;
|
35 |
| -import com.netflix.spinnaker.clouddriver.docker.registry.api.v2.exception.DockerRegistryOperationException; |
36 | 34 | import com.netflix.spinnaker.kork.retrofit.ErrorHandlingExecutorCallAdapterFactory;
|
37 | 35 | import java.util.Arrays;
|
38 | 36 | import java.util.Map;
|
@@ -246,12 +244,8 @@ public void testTagsResponse_With_AdditionalFields() throws JsonProcessingExcept
|
246 | 244 | .withStatus(HttpStatus.OK.value())
|
247 | 245 | .withBody(objectMapper.writeValueAsString(tagsResponse))));
|
248 | 246 |
|
249 |
| - // TODO: Fix this issue by adding configuration to the ObjectMapper to ignore unknown fields |
250 |
| - assertThrows( |
251 |
| - DockerRegistryOperationException.class, |
252 |
| - () -> dockerRegistryClient.getTags("library/nginx"), |
253 |
| - "Failed to parse ResponseBody : Unrecognized field \"child\" " |
254 |
| - + "(class com.netflix.spinnaker.clouddriver.docker.registry.api.v2.client.DockerRegistryTags), " |
255 |
| - + "not marked as ignorable (3 known properties: \"tags\", \"name\", \"metaClass\"])"); |
| 247 | + DockerRegistryTags dockerRegistryTags = dockerRegistryClient.getTags("library/nginx"); |
| 248 | + String[] tags = (String[]) tagsResponse.get("tags"); |
| 249 | + assertIterableEquals(Arrays.asList(tags), dockerRegistryTags.getTags()); |
256 | 250 | }
|
257 | 251 | }
|
0 commit comments