Authorization extends AcmeJsonResource { public void deactivate() throws AcmeException { LOG.debug("deactivate"); try (Connection conn = getSession().connect()) { JSONBuilder claims = new JSONBuilder(); claims.put("status", "deactivated"); conn.sendSignedRequest(getLocation(), claims, getLogin()); setJSON(conn.readJsonResponse()); } } protected  Authorization(Login login, URL location); Identifier getIdentifier(); Status getStatus(); @Nullable Instant getExpires(); boolean isWildcard(); List<Challenge> getChallenges(); @Nullable T findChallenge(final String type); @Nullable T findChallenge(Class<T> type); void deactivate();  }
@Test public void testDeactivate() throws Exception { TestableConnectionProvider provider = new TestableConnectionProvider() { @Override public int sendSignedRequest(URL url, JSONBuilder claims, Login login) { JSON json = claims.toJSON(); assertThat(json.get("status").asString(), is("deactivated")); assertThat(url, is(locationUrl)); assertThat(login, is(notNullValue())); return HttpURLConnection.HTTP_OK; } @Override public JSON readJsonResponse() { return getJSON("updateAuthorizationResponse"); } }; Login login = provider.createLogin(); provider.putTestChallenge("http-01", Http01Challenge::new); provider.putTestChallenge("dns-01", Dns01Challenge::new); provider.putTestChallenge("tls-alpn-01", TlsAlpn01Challenge::new); Authorization auth = new Authorization(login, locationUrl); auth.deactivate(); provider.close(); }