Commit e73f8c10 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #17505 from dreis2211

* pr/17505:
  Polish

Closes gh-17505
parents b7e092e8 82047a25
......@@ -166,7 +166,7 @@ class EndpointDiscovererTests {
void getEndpointsWhenTtlSetByIdAndIdDoesNotMatchShouldNotCacheInvokeCalls() {
load(TestEndpointConfiguration.class, (context) -> {
TestEndpointDiscoverer discoverer = new TestEndpointDiscoverer(context,
(endpointId) -> (endpointId.equals("foo") ? 500L : 0L));
(endpointId) -> (endpointId.equals(EndpointId.of("foo")) ? 500L : 0L));
Map<EndpointId, TestExposableEndpoint> endpoints = mapEndpoints(discoverer.getEndpoints());
assertThat(endpoints).containsOnlyKeys(EndpointId.of("test"));
Map<Method, TestOperation> operations = mapOperations(endpoints.get(EndpointId.of("test")));
......
......@@ -17,7 +17,7 @@
package org.springframework.boot.test.json;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
......@@ -57,17 +57,14 @@ class DuplicateJsonObjectContextCustomizerFactory implements ContextCustomizerFa
}
private List<URL> findJsonObjects() {
List<URL> jsonObjects = new ArrayList<>();
try {
Enumeration<URL> resources = getClass().getClassLoader().getResources("org/json/JSONObject.class");
while (resources.hasMoreElements()) {
jsonObjects.add(resources.nextElement());
}
return Collections.list(resources);
}
catch (Exception ex) {
// Continue
}
return jsonObjects;
return Collections.emptyList();
}
private void logDuplicateJsonObjectsWarning(List<URL> jsonObjects) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment