refactor asserts in ExportImportTest to be more verbose

This commit is contained in:
vramik 2017-01-31 13:24:06 +01:00
parent 9a16805f17
commit aec59a7e91

View file

@ -155,7 +155,7 @@ public class ExportImportTest extends AbstractKeycloakTest {
removeRealm("test");
removeRealm("test-realm");
assertEquals(1, adminClient.realms().findAll().size());
Assert.assertNames(adminClient.realms().findAll(), "master");
assertNotAuthenticated("test", "test-user@localhost", "password");
assertNotAuthenticated("test", "user1", "password");
@ -168,7 +168,7 @@ public class ExportImportTest extends AbstractKeycloakTest {
testingClient.testing().exportImport().runImport();
// Ensure data are imported back
assertEquals(3, adminClient.realms().findAll().size());
Assert.assertNames(adminClient.realms().findAll(), "master", "test", "test-realm");
assertAuthenticated("test", "test-user@localhost", "password");
assertAuthenticated("test", "user1", "password");
@ -191,7 +191,7 @@ public class ExportImportTest extends AbstractKeycloakTest {
// Delete some realm (and some data in admin realm)
adminClient.realm("test").remove();
assertEquals(2, adminClient.realms().findAll().size());
Assert.assertNames(adminClient.realms().findAll(), "test-realm", "master");
assertNotAuthenticated("test", "test-user@localhost", "password");
assertNotAuthenticated("test", "user1", "password");
@ -204,7 +204,7 @@ public class ExportImportTest extends AbstractKeycloakTest {
testingClient.testing().exportImport().runImport();
// Ensure data are imported back, but just for "test" realm
assertEquals(3, adminClient.realms().findAll().size());
Assert.assertNames(adminClient.realms().findAll(), "master", "test", "test-realm");
assertAuthenticated("test", "test-user@localhost", "password");
assertAuthenticated("test", "user1", "password");