@Test public void should_build_5() { String status = "5"; StatusBuilder statusBuilder = new StatusBuilder(createNotificationResponse(0), createInboxResponse(5)); assertEquals(statusBuilder.buildCondensed(), status); statusBuilder = new StatusBuilder(createNotificationResponse(5), createInboxResponse(0)); assertEquals(status, statusBuilder.buildCondensed()); statusBuilder = new StatusBuilder(createNotificationResponse(2), createInboxResponse(3)); assertEquals(status, statusBuilder.buildCondensed()); statusBuilder = new StatusBuilder(createNotificationResponse(5), null); assertEquals(status, statusBuilder.buildCondensed()); statusBuilder = new StatusBuilder(null, createInboxResponse(5)); assertEquals(status, statusBuilder.buildCondensed()); statusBuilder = new StatusBuilder(createNotificationResponse(5), createInvalidInboxResponse()); assertEquals(status, statusBuilder.buildCondensed()); statusBuilder = new StatusBuilder(createInvalidNotificationResponse(), createInboxResponse(5)); assertEquals(status, statusBuilder.buildCondensed()); }
public String buildCondensed() { String status = ""; if(validNotificationsResponse() && validInboxResponse()) { status = String.valueOf(notificationResponse.count + inboxResponse.count); } else if(validNotificationsResponse()) { status = String.valueOf(notificationResponse.count); } else if(validInboxResponse()) { status = String.valueOf(inboxResponse.count); } return status; }
StatusBuilder extends UpdateBuilder { public String buildCondensed() { String status = ""; if(validNotificationsResponse() && validInboxResponse()) { status = String.valueOf(notificationResponse.count + inboxResponse.count); } else if(validNotificationsResponse()) { status = String.valueOf(notificationResponse.count); } else if(validInboxResponse()) { status = String.valueOf(inboxResponse.count); } return status; } }
StatusBuilder extends UpdateBuilder { public String buildCondensed() { String status = ""; if(validNotificationsResponse() && validInboxResponse()) { status = String.valueOf(notificationResponse.count + inboxResponse.count); } else if(validNotificationsResponse()) { status = String.valueOf(notificationResponse.count); } else if(validInboxResponse()) { status = String.valueOf(inboxResponse.count); } return status; } StatusBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse); }
StatusBuilder extends UpdateBuilder { public String buildCondensed() { String status = ""; if(validNotificationsResponse() && validInboxResponse()) { status = String.valueOf(notificationResponse.count + inboxResponse.count); } else if(validNotificationsResponse()) { status = String.valueOf(notificationResponse.count); } else if(validInboxResponse()) { status = String.valueOf(inboxResponse.count); } return status; } StatusBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse); String buildCondensed(); String build(); }
StatusBuilder extends UpdateBuilder { public String buildCondensed() { String status = ""; if(validNotificationsResponse() && validInboxResponse()) { status = String.valueOf(notificationResponse.count + inboxResponse.count); } else if(validNotificationsResponse()) { status = String.valueOf(notificationResponse.count); } else if(validInboxResponse()) { status = String.valueOf(inboxResponse.count); } return status; } StatusBuilder(NotificationsResponse notificationsResponse, InboxResponse inboxResponse); String buildCondensed(); String build();  }