@Test public void fromDeploymentWithOtherStateTest() { Deployment deployment1 = new Deployment(); deployment1.setId(11); deployment1.setHref("href"); deployment1.setPrice("provider-id"); deployment1.setStatus("STATUS"); deployment1.setStartDate("aaa"); deployment1.setEndDate("bbb"); ApplicationManagerMessage amMessage = MessageCreator.fromDeployment("name", deployment1, "OTHER_STATE"); assertEquals("name", amMessage.getApplicationId()); assertEquals("11", amMessage.getDeploymentId()); assertEquals("OTHER_STATE", amMessage.getStatus()); }
public static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status) { if(applicationName == null || deployment == null) { return null; } ApplicationManagerMessage message = new ApplicationManagerMessage(); message.setApplicationId(applicationName); completeMessage(message, deployment, status); return message; }
MessageCreator { public static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status) { if(applicationName == null || deployment == null) { return null; } ApplicationManagerMessage message = new ApplicationManagerMessage(); message.setApplicationId(applicationName); completeMessage(message, deployment, status); return message; } }
MessageCreator { public static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status) { if(applicationName == null || deployment == null) { return null; } ApplicationManagerMessage message = new ApplicationManagerMessage(); message.setApplicationId(applicationName); completeMessage(message, deployment, status); return message; }  }
MessageCreator { public static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status) { if(applicationName == null || deployment == null) { return null; } ApplicationManagerMessage message = new ApplicationManagerMessage(); message.setApplicationId(applicationName); completeMessage(message, deployment, status); return message; }  static ApplicationManagerMessage fromApplication(Application application); static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status); static ApplicationManagerMessage fromVM(String applicationName, Deployment deployment, VM vm); }
MessageCreator { public static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status) { if(applicationName == null || deployment == null) { return null; } ApplicationManagerMessage message = new ApplicationManagerMessage(); message.setApplicationId(applicationName); completeMessage(message, deployment, status); return message; }  static ApplicationManagerMessage fromApplication(Application application); static ApplicationManagerMessage fromDeployment(String applicationName, Deployment deployment, String status); static ApplicationManagerMessage fromVM(String applicationName, Deployment deployment, VM vm);  }