@@ -1659,6 +1659,18 @@ public void shouldGetUserGuardianEnrollments() throws Exception {
16591659 assertThat (response , is (notNullValue ()));
16601660 }
16611661
1662+ @ Test
1663+ public void shouldReturnEmptyUserGuardianEnrollments () throws Exception {
1664+ Request <List <GuardianEnrollment >> request = api .getUserGuardianEnrollments ("1" );
1665+ assertThat (request , is (notNullValue ()));
1666+
1667+ server .jsonResponse (MGMT_EMPTY_LIST , 200 );
1668+ List <GuardianEnrollment > response = request .execute ();
1669+
1670+ assertThat (response , is (notNullValue ()));
1671+ assertThat (response , is (emptyCollectionOf (GuardianEnrollment .class )));
1672+ }
1673+
16621674 @ Test
16631675 public void shouldThrowOnGetUserLogEventsWithNullId () throws Exception {
16641676 exception .expect (IllegalArgumentException .class );
@@ -1776,8 +1788,6 @@ public void shouldReturnEmptyUserLogEvents() throws Exception {
17761788 assertThat (response .getItems (), is (emptyCollectionOf (LogEvent .class )));
17771789 }
17781790
1779- //TODO: Add empty arrays validation
1780-
17811791 @ Test
17821792 public void shouldThrowOnDeleteUserMultifactorProviderWithNullId () throws Exception {
17831793 exception .expect (IllegalArgumentException .class );
@@ -1958,6 +1968,18 @@ public void shouldGetBlacklistedTokens() throws Exception {
19581968 assertThat (response , hasSize (2 ));
19591969 }
19601970
1971+ @ Test
1972+ public void shouldReturnEmptyBlacklistedTokens () throws Exception {
1973+ Request <List <Token >> request = api .getBlacklistedTokens ("myapi" );
1974+ assertThat (request , is (notNullValue ()));
1975+
1976+ server .jsonResponse (MGMT_EMPTY_LIST , 200 );
1977+ List <Token > response = request .execute ();
1978+
1979+ assertThat (response , is (notNullValue ()));
1980+ assertThat (response , is (emptyCollectionOf (Token .class )));
1981+ }
1982+
19611983 @ Test
19621984 public void shouldThrowOnBlacklistTokensWithNullToken () throws Exception {
19631985 exception .expect (IllegalArgumentException .class );
@@ -2196,6 +2218,18 @@ public void shouldListGuardianFactors() throws Exception {
21962218 assertThat (response , hasSize (2 ));
21972219 }
21982220
2221+ @ Test
2222+ public void shouldReturnEmptyGuardianFactors () throws Exception {
2223+ Request <List <GuardianFactor >> request = api .listGuardianFactors ();
2224+ assertThat (request , is (notNullValue ()));
2225+
2226+ server .jsonResponse (MGMT_EMPTY_LIST , 200 );
2227+ List <GuardianFactor > response = request .execute ();
2228+
2229+ assertThat (response , is (notNullValue ()));
2230+ assertThat (response , is (emptyCollectionOf (GuardianFactor .class )));
2231+ }
2232+
21992233 @ Test
22002234 public void shouldThrowOnUpdateGuardianFactorWithNullName () throws Exception {
22012235 exception .expect (IllegalArgumentException .class );
0 commit comments