Skip to content

Commit

Permalink
Update a two tests files that contain deprecated methods. (#8765)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-ry4n authored Oct 22, 2024
1 parent 2550254 commit d9a2585
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import static org.mockito.Mockito.when;

import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -56,7 +56,8 @@ void setup() throws IOException {
when(metricsConfig.getPublicationInterval()).thenReturn(1);
when(metricsEndpoint.getMetricsSystem()).thenReturn(prometheusMetricsSystem);
when(metricsEndpoint.getMetricConfig()).thenReturn(metricsConfig);
when(metricsConfig.getMetricsEndpoint()).thenReturn(Optional.of(new URL("http://host.com/")));
when(metricsConfig.getMetricsEndpoint())
.thenReturn(Optional.of(URI.create("http://host.com/").toURL()));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.google.common.collect.ImmutableList;
import com.google.common.io.Resources;
import java.io.IOException;
Expand All @@ -44,12 +45,13 @@ public class OpenApiTestUtil<TObject> {
private final String path;

public OpenApiTestUtil(final Class<TObject> clazz) {
this.mapper = new ObjectMapper();
mapper
.configure(SerializationFeature.INDENT_OUTPUT, true)
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true)
.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true)
.configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, true);
this.mapper =
JsonMapper.builder()
.configure(SerializationFeature.INDENT_OUTPUT, true)
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true)
.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true)
.configure(DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, true)
.build();
this.clazz = clazz;
this.path = clazz.getPackageName().replaceAll("\\.", "/");
}
Expand Down

0 comments on commit d9a2585

Please sign in to comment.