@Test public void testAlreadyExistsDoesNotError() throws Exception { profileService.saveProfile(ProfileId.NATIVE, Profile.NATIVE); BootstrapStepResult result = nativeProfileCreator.execute("label", new JsonObject()); BootstrapStepResult expected = new BootstrapStepResult("label", BootstrapStepResult.Status.SUCCEEDED); Assert.assertEquals(expected, result); Assert.assertEquals(Profile.NATIVE, profileService.getProfile(ProfileId.NATIVE)); } }
@Test public void testCreation() throws Exception { try { profileService.getProfile(ProfileId.NATIVE); Assert.fail("Native profile should not exist."); } catch (NotFoundException e) { // expected } BootstrapStepResult result = nativeProfileCreator.execute("label", new JsonObject()); BootstrapStepResult expected = new BootstrapStepResult("label", BootstrapStepResult.Status.SUCCEEDED); Assert.assertEquals(expected, result); Assert.assertEquals(Profile.NATIVE, profileService.getProfile(ProfileId.NATIVE)); }