use of io.swagger.v3.parser.ResolverCache in project swagger-parser by swagger-api.
the class ResolverCacheTest method testLoadInternalParameterRef.
@Test
public void testLoadInternalParameterRef(@Injectable Parameter mockedParameter) throws Exception {
OpenAPI openAPI = new OpenAPI();
openAPI.components(new Components().addParameters("foo", mockedParameter));
ResolverCache cache = new ResolverCache(openAPI, auths, null);
Parameter actualResult = cache.loadRef("#/components/parameters/foo", RefFormat.INTERNAL, Parameter.class);
assertEquals(actualResult, mockedParameter);
assertNull(cache.loadRef("#/components/parameters/bar", RefFormat.INTERNAL, Parameter.class));
assertNull(cache.loadRef("#/params/foo", RefFormat.INTERNAL, Parameter.class));
}
Aggregations