mirror of https://github.com/shred/acme4j
Enable unit test for Pebble account deactivation
parent
288b3a8cd0
commit
231bad3560
|
@ -210,7 +210,6 @@ public class AccountIT extends PebbleITBase {
|
||||||
* Deactivate an account.
|
* Deactivate an account.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@Ignore // TODO PEBBLE: missing
|
|
||||||
public void testDeactivate() throws AcmeException {
|
public void testDeactivate() throws AcmeException {
|
||||||
KeyPair keyPair = createKeyPair();
|
KeyPair keyPair = createKeyPair();
|
||||||
Session session = new Session(pebbleURI());
|
Session session = new Session(pebbleURI());
|
||||||
|
@ -223,10 +222,18 @@ public class AccountIT extends PebbleITBase {
|
||||||
|
|
||||||
acct.deactivate();
|
acct.deactivate();
|
||||||
|
|
||||||
|
// Make sure it is deactivated now...
|
||||||
|
assertThat(acct.getStatus(), is(Status.DEACTIVATED));
|
||||||
|
|
||||||
|
// Make sure account cannot be accessed any more...
|
||||||
|
try {
|
||||||
Session session2 = new Session(pebbleURI());
|
Session session2 = new Session(pebbleURI());
|
||||||
Account acct2 = session2.login(location, keyPair).getAccount();
|
Account acct2 = session2.login(location, keyPair).getAccount();
|
||||||
assertThat(acct2.getLocation(), is(location));
|
acct2.update();
|
||||||
assertThat(acct2.getStatus(), is(Status.DEACTIVATED));
|
fail("Account can still be accessed");
|
||||||
|
} catch (AcmeUnauthorizedException ex) {
|
||||||
|
assertThat(ex.getMessage(), is("Account has been deactivated"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue