mirror of https://github.com/shred/acme4j
Account deactivation returns HTTP_OK and current account data
parent
c4f75497c7
commit
4e1ad652b0
|
@ -269,7 +269,9 @@ public class Registration extends AcmeResource {
|
||||||
claims.put(KEY_STATUS, "deactivated");
|
claims.put(KEY_STATUS, "deactivated");
|
||||||
|
|
||||||
conn.sendSignedRequest(getLocation(), claims, getSession());
|
conn.sendSignedRequest(getLocation(), claims, getSession());
|
||||||
conn.accept(HttpURLConnection.HTTP_OK, HttpURLConnection.HTTP_ACCEPTED);
|
conn.accept(HttpURLConnection.HTTP_OK);
|
||||||
|
|
||||||
|
unmarshal(conn.readJsonResponse());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -433,15 +433,21 @@ public class RegistrationTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int accept(int... httpStatus) throws AcmeException {
|
public int accept(int... httpStatus) throws AcmeException {
|
||||||
assertThat(httpStatus, isIntArrayContainingInAnyOrder(
|
assertThat(httpStatus, isIntArrayContainingInAnyOrder(HttpURLConnection.HTTP_OK));
|
||||||
HttpURLConnection.HTTP_OK, HttpURLConnection.HTTP_ACCEPTED));
|
return HttpURLConnection.HTTP_OK;
|
||||||
return HttpURLConnection.HTTP_ACCEPTED;
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSON readJsonResponse() {
|
||||||
|
return getJSON("deactivateRegistrationResponse");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Registration registration = new Registration(provider.createSession(), locationUrl);
|
Registration registration = new Registration(provider.createSession(), locationUrl);
|
||||||
registration.deactivate();
|
registration.deactivate();
|
||||||
|
|
||||||
|
assertThat(registration.getStatus(), is(Status.DEACTIVATED));
|
||||||
|
|
||||||
provider.close();
|
provider.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"status": "deactivated"
|
||||||
|
}
|
Loading…
Reference in New Issue