@Test public void analysePathTest() { SiegfriedClientFactory.changeMode(null); final SiegfriedClient client = SiegfriedClientFactory.getInstance().getClient(); assertNotNull(client); Boolean catchException = false; RequestResponse<JsonNode> response = null; try { response = client.analysePath(Paths.get("identify")); } catch (final Exception lce) { catchException = true; } assertFalse(catchException); assertNotNull(response); assertEquals(1, response.toJsonNode().get("$results").get(0).get("files").size()); }
@Override public RequestResponse<JsonNode> analysePath(Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { return new RequestResponseOK().addResult(getFormatJson(filePath)); }
SiegfriedClientMock extends AbstractMockClient implements SiegfriedClient { @Override public RequestResponse<JsonNode> analysePath(Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { return new RequestResponseOK().addResult(getFormatJson(filePath)); } }
SiegfriedClientMock extends AbstractMockClient implements SiegfriedClient { @Override public RequestResponse<JsonNode> analysePath(Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { return new RequestResponseOK().addResult(getFormatJson(filePath)); }  }
SiegfriedClientMock extends AbstractMockClient implements SiegfriedClient { @Override public RequestResponse<JsonNode> analysePath(Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { return new RequestResponseOK().addResult(getFormatJson(filePath)); }  @Override RequestResponse<JsonNode> status(Path filePath); @Override RequestResponse<JsonNode> analysePath(Path filePath); }
SiegfriedClientMock extends AbstractMockClient implements SiegfriedClient { @Override public RequestResponse<JsonNode> analysePath(Path filePath) throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { return new RequestResponseOK().addResult(getFormatJson(filePath)); }  @Override RequestResponse<JsonNode> status(Path filePath); @Override RequestResponse<JsonNode> analysePath(Path filePath);  }