@Test(expected = FormatIdentifierTechnicalException.class) public void testSiegfriedStatusInternalError() throws Exception { reset(siegfriedClientRest); when(siegfriedClientRest.status(VERSION_PATH)).thenThrow(FormatIdentifierTechnicalException.class); siegfried.status(); }
@Override public FormatIdentifierInfo status() throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Check Siegfried status"); } try (SiegfriedClient siegfriedClient = siegfriedClientFactory.getClient()) { final RequestResponse<JsonNode> response = siegfriedClient.status(versionPath); final String version = response.toJsonNode().get("$results").get(0).get("siegfried").asText(); return new FormatIdentifierInfo(version, "Siegfried"); } }
FormatIdentifierSiegfried implements FormatIdentifier { @Override public FormatIdentifierInfo status() throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Check Siegfried status"); } try (SiegfriedClient siegfriedClient = siegfriedClientFactory.getClient()) { final RequestResponse<JsonNode> response = siegfriedClient.status(versionPath); final String version = response.toJsonNode().get("$results").get(0).get("siegfried").asText(); return new FormatIdentifierInfo(version, "Siegfried"); } } }
FormatIdentifierSiegfried implements FormatIdentifier { @Override public FormatIdentifierInfo status() throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Check Siegfried status"); } try (SiegfriedClient siegfriedClient = siegfriedClientFactory.getClient()) { final RequestResponse<JsonNode> response = siegfriedClient.status(versionPath); final String version = response.toJsonNode().get("$results").get(0).get("siegfried").asText(); return new FormatIdentifierInfo(version, "Siegfried"); } } FormatIdentifierSiegfried(Map<String, Object> configurationProperties); @VisibleForTesting  FormatIdentifierSiegfried(SiegfriedClientFactory siegfriedClientFactory, Path versionPath); }
FormatIdentifierSiegfried implements FormatIdentifier { @Override public FormatIdentifierInfo status() throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Check Siegfried status"); } try (SiegfriedClient siegfriedClient = siegfriedClientFactory.getClient()) { final RequestResponse<JsonNode> response = siegfriedClient.status(versionPath); final String version = response.toJsonNode().get("$results").get(0).get("siegfried").asText(); return new FormatIdentifierInfo(version, "Siegfried"); } } FormatIdentifierSiegfried(Map<String, Object> configurationProperties); @VisibleForTesting  FormatIdentifierSiegfried(SiegfriedClientFactory siegfriedClientFactory, Path versionPath); @Override FormatIdentifierInfo status(); @Override List<FormatIdentifierResponse> analysePath(Path path); }
FormatIdentifierSiegfried implements FormatIdentifier { @Override public FormatIdentifierInfo status() throws FormatIdentifierTechnicalException, FormatIdentifierNotFoundException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Check Siegfried status"); } try (SiegfriedClient siegfriedClient = siegfriedClientFactory.getClient()) { final RequestResponse<JsonNode> response = siegfriedClient.status(versionPath); final String version = response.toJsonNode().get("$results").get(0).get("siegfried").asText(); return new FormatIdentifierInfo(version, "Siegfried"); } } FormatIdentifierSiegfried(Map<String, Object> configurationProperties); @VisibleForTesting  FormatIdentifierSiegfried(SiegfriedClientFactory siegfriedClientFactory, Path versionPath); @Override FormatIdentifierInfo status(); @Override List<FormatIdentifierResponse> analysePath(Path path); static final String PRONOM_NAMESPACE; static final String UNKNOW_NAMESPACE; }