@Test public void should_build_blank() { String body = ""; BodyBuilder bodyBuilder = new BodyBuilder(createInvalidNotificationResponse(), createInvalidInboxResponse()); assertEquals(body, bodyBuilder.build()); }
public String build() { String body = ""; if(validNotificationsResponse() && validInboxResponse() && notificationResponse.count > 0 && inboxResponse.count > 0) { Date notificationDate = notificationResponse.getNotificationDate(); Date messageDate = inboxResponse.time; body = notificationDate.getTime() > messageDate.getTime() ? notificationResponse.getNotificationText() : inboxResponse.getText(); } else if(validNotificationsResponse() && notificationResponse.count > 0) { body = notificationResponse.getNotificationText(); } else if(validInboxResponse()) { body = inboxResponse.getText(); } return body; }
BodyBuilder extends UpdateBuilder { public String build() { String body = ""; if(validNotificationsResponse() && validInboxResponse() && notificationResponse.count > 0 && inboxResponse.count > 0) { Date notificationDate = notificationResponse.getNotificationDate(); Date messageDate = inboxResponse.time; body = notificationDate.getTime() > messageDate.getTime() ? notificationResponse.getNotificationText() : inboxResponse.getText(); } else if(validNotificationsResponse() && notificationResponse.count > 0) { body = notificationResponse.getNotificationText(); } else if(validInboxResponse()) { body = inboxResponse.getText(); } return body; } }
BodyBuilder extends UpdateBuilder { public String build() { String body = ""; if(validNotificationsResponse() && validInboxResponse() && notificationResponse.count > 0 && inboxResponse.count > 0) { Date notificationDate = notificationResponse.getNotificationDate(); Date messageDate = inboxResponse.time; body = notificationDate.getTime() > messageDate.getTime() ? notificationResponse.getNotificationText() : inboxResponse.getText(); } else if(validNotificationsResponse() && notificationResponse.count > 0) { body = notificationResponse.getNotificationText(); } else if(validInboxResponse()) { body = inboxResponse.getText(); } return body; } BodyBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse); }
BodyBuilder extends UpdateBuilder { public String build() { String body = ""; if(validNotificationsResponse() && validInboxResponse() && notificationResponse.count > 0 && inboxResponse.count > 0) { Date notificationDate = notificationResponse.getNotificationDate(); Date messageDate = inboxResponse.time; body = notificationDate.getTime() > messageDate.getTime() ? notificationResponse.getNotificationText() : inboxResponse.getText(); } else if(validNotificationsResponse() && notificationResponse.count > 0) { body = notificationResponse.getNotificationText(); } else if(validInboxResponse()) { body = inboxResponse.getText(); } return body; } BodyBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse); String build(); }
BodyBuilder extends UpdateBuilder { public String build() { String body = ""; if(validNotificationsResponse() && validInboxResponse() && notificationResponse.count > 0 && inboxResponse.count > 0) { Date notificationDate = notificationResponse.getNotificationDate(); Date messageDate = inboxResponse.time; body = notificationDate.getTime() > messageDate.getTime() ? notificationResponse.getNotificationText() : inboxResponse.getText(); } else if(validNotificationsResponse() && notificationResponse.count > 0) { body = notificationResponse.getNotificationText(); } else if(validInboxResponse()) { body = inboxResponse.getText(); } return body; } BodyBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse); String build();  }