use of com.reprezen.swagedit.openapi3.validation.OpenApi3ReferenceValidator.OpenApi3ReferenceFactory in project KaiZen-OpenAPI-Editor by RepreZen.
the class Mocks method mockJsonReferenceFactory.
public static OpenApi3ReferenceFactory mockJsonReferenceFactory(final Map<URI, JsonNode> entries) {
final IFile file = mock(IFile.class);
when(file.exists()).thenReturn(true);
return new OpenApi3ReferenceValidator.OpenApi3ReferenceFactory() {
public JsonReference create(AbstractNode node) {
JsonReference ref = super.create(node);
ref.setDocumentManager(new JsonDocumentManager() {
@Override
public IFile getFile(URI uri) {
return file;
}
@Override
public JsonNode getDocument(URI uri) {
return entries.get(uri);
}
});
return ref;
}
};
}
Aggregations