@Test public void linkDeclinedShouldChangeStatusAndSendMail() { VirtualPortCreateRequestLink link = new VirtualPortCreateRequestLinkFactory().setStatus(RequestStatus.PENDING).create(); subject.declineCreateRequestLink(link, "I don't like you"); assertThat(link.getStatus(), is(RequestStatus.DECLINED)); verify(virtualPortCreateRequestLinkRepoMock).save(link); verify(emailSenderMock).sendVirtualPortCreateRequestDeclineMail(link); }
@Test public void linkApprovedShouldChangesStatusAndSentMail() { VirtualPortCreateRequestLink link = new VirtualPortCreateRequestLinkFactory().setStatus(RequestStatus.PENDING).create(); LocalVirtualPort port = new LocalVirtualPortFactory().create(); subject.approveCreateRequestLink(link, port); assertThat(link.getStatus(), is(RequestStatus.APPROVED)); verify(virtualPortRepoMock).save(port); verify(emailSenderMock).sendVirtualPortCreateRequestApproveMail(link, port); }