Search in sources :

Example 1 with CheckinMessage

use of org.eclipse.vorto.repository.notification.message.CheckinMessage in project vorto by eclipse.

the class NotificationServiceTest method testSendCheckedModelEmail.

@Test
public void testSendCheckedModelEmail() throws Exception {
    User user = new User();
    user.setEmail("alexander.edelmann@bosch-si.com");
    user.setUsername("aedelmann");
    ModelInfo resource = new ModelInfo(new ModelId("Fridge", "org.eclipse.vorto.examples", "1.0.0"), ModelType.Functionblock);
    resource.setAuthor("andreas");
    resource.setCreationDate(new Date());
    resource.setDescription("A fridge keeps groceries fresh");
    notificationService.sendNotification(new CheckinMessage(user, resource));
    assertEquals(1, wiser.getMessages().size());
    assertTrue(((String) wiser.getMessages().get(0).getMimeMessage().getContent()).contains("A new model has just been checked into the Vorto Repository"));
    assertTrue(((String) wiser.getMessages().get(0).getMimeMessage().getContent()).contains("Dear aedelmann"));
}
Also used : ModelInfo(org.eclipse.vorto.repository.api.ModelInfo) User(org.eclipse.vorto.repository.account.impl.User) CheckinMessage(org.eclipse.vorto.repository.notification.message.CheckinMessage) ModelId(org.eclipse.vorto.repository.api.ModelId) Date(java.util.Date) Test(org.junit.Test)

Aggregations

Date (java.util.Date)1 User (org.eclipse.vorto.repository.account.impl.User)1 ModelId (org.eclipse.vorto.repository.api.ModelId)1 ModelInfo (org.eclipse.vorto.repository.api.ModelInfo)1 CheckinMessage (org.eclipse.vorto.repository.notification.message.CheckinMessage)1 Test (org.junit.Test)1