@Test public void scheduleCreateOperation() { cache.scheduleCreateOperation(); assertThat( cache.getCrudOperationToBePerformed(), is(new CreateOperation<>(repository, decision))); }
@Test public void createNewDecision() { final Beneficiary beneficiary = mock(Beneficiary.class); final SocialProtectionDecision expected = mock(SocialProtectionDecision.class); when(beneficiary.addNewSocialProtectionDecision()).thenReturn(expected); SocialProtectionDecision result = cache.createNewDecision(beneficiary); assertThat(cache.getDecision(), is(expected)); assertThat(cache.getDecision(), is(result)); }
@Test public void addADocumentAsAConfirmationOfCachedDecition() { final ConfirmationDocument confirmationDocument = mock(ConfirmationDocument.class); cache.addConfirmationDocumentToDecition(confirmationDocument); verify(decision).addConfirmationDocument(confirmationDocument); }
@Test public void removeGivenConfirmationFromTheDecision() { final ConfirmationDocument confirmationDocument = mock(ConfirmationDocument.class); cache.removeConfirmationDocumentFromDecision(confirmationDocument); verify(decision).removeConfirmationDocument(confirmationDocument); }
@Test public void updateDecisionWithBeneficiary() { final Beneficiary beneficiary = mock(Beneficiary.class); cache.updateDecisionWithBeneficiary(beneficiary); verify(decision).setBeneficiary(beneficiary); }
@Test public void shouldUpdateCachedDecisionWithGivenDecree() { final Decree decree = mock(Decree.class); cache.updateDecisionWithDecree(decree); verify(decision).setDecree(decree); }
@Test public void shouldUpdateCachedDecisionWithGivenSupervisor() { final SocialProtectionAuthority supervisor = mock(SocialProtectionAuthority.class); cache.updateDecisionWithSupervisor(supervisor); verify(decision).setSupervisor(supervisor); }