Created
June 25, 2013 11:45
-
-
Save novoj/5857867 to your computer and use it in GitHub Desktop.
Recipient subscription from external application.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void shouldSubscribeAlreadyConfirmedRecipientByExternalApplication() throws Exception { | |
Recipient rcp = recipientListManager.createNewRecipient(); | |
rcp.setName("Uďo"); | |
rcp.setAddress(new EmailAddress("[email protected]")); | |
recipientListManager.subscribeConfirmedRecipient(rcp); | |
Recipient createdRcpt = recipientListManager.getRecipientByAddress("[email protected]"); | |
assertNotNull(createdRcpt); | |
assertEquals(RecipientState.Confirmed, createdRcpt.getState()); | |
recipientListManager.unsubscribeRecipientByAdmin(createdRcpt); | |
Recipient newSubscrption = recipientListManager.createNewRecipient(); | |
newSubscrption.setName("Uďo 2"); | |
newSubscrption.setAddress(new EmailAddress("[email protected]")); | |
recipientListManager.subscribeConfirmedRecipient(newSubscrption); | |
Recipient updatedRcpt = recipientListManager.getRecipientByAddress("[email protected]"); | |
assertNotNull(updatedRcpt); | |
assertEquals("Uďo 2", updatedRcpt.getName()); | |
assertEquals(createdRcpt.getId(), updatedRcpt.getId()); | |
assertEquals(RecipientState.Confirmed, updatedRcpt.getState()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment