@@ -1484,6 +1484,35 @@ public void listAuthenticatorsRequest() throws Exception {
14841484 assertThat (response , is (notNullValue ()));
14851485 }
14861486
1487+ @ Test
1488+ public void deleteAuthenticatorThrowsWhenTokenNull () {
1489+ exception .expect (IllegalArgumentException .class );
1490+ exception .expectMessage ("'access token' cannot be null!" );
1491+ api .deleteAuthenticator (null , "authenticatorId" );
1492+ }
1493+
1494+ @ Test
1495+ public void deleteAuthenticatorThrowsWhenAuthenticatorIdNull () {
1496+ exception .expect (IllegalArgumentException .class );
1497+ exception .expectMessage ("'authenticator id' cannot be null!" );
1498+ api .deleteAuthenticator ("Bearer accessToken" , null );
1499+ }
1500+
1501+ @ Test
1502+ public void deleteAuthenticatorRequest () throws Exception {
1503+ Request <Void > request = api .deleteAuthenticator ("accessToken" , "authenticatorId" );
1504+
1505+ server .jsonResponse (AUTH_LIST_AUTHENTICATORS_RESPONSE , 200 );
1506+ Void response = request .execute ().getBody ();
1507+ RecordedRequest recordedRequest = server .takeRequest ();
1508+
1509+ assertThat (recordedRequest , hasMethodAndPath (HttpMethod .DELETE , "/mfa/authenticators/authenticatorId" ));
1510+ assertThat (recordedRequest , hasHeader ("Content-Type" , "application/json" ));
1511+ assertThat (recordedRequest , hasHeader ("Authorization" , "Bearer accessToken" ));
1512+
1513+ assertThat (response , is (nullValue ()));
1514+ }
1515+
14871516 @ Test
14881517 public void challengeRequestThrowsWhenTokenNull () {
14891518 exception .expect (IllegalArgumentException .class );
0 commit comments