### Question:
AmqpProducer { public static void sendVMDeletedMessage(String applicationName, Deployment deployment, VM vm) { ApplicationManagerMessage amMessage = MessageCreator.fromVM(applicationName, deployment, vm); AmqpProducer.sendMessage(APPLLICATION_PATH + "." + applicationName + "." + DEPLOYMENT_PATH + "." + deployment.getId() + "." + VM_PATH + "." + vm.getId() + "." + DELETED, amMessage, true); }  static void sendMessage(String topic, ApplicationManagerMessage message, boolean toLog); static void sendNewApplicationMessage(Application application); static void sendDeploymentSubmittedMessage(Application application); static void sendDeploymentNegotiatingMessage(String applicationName, Deployment deployment); static void sendDeploymentNegotiatedMessage(String applicationName, Deployment deployment); static void sendDeploymentContextualizingMessage(String applicationName, Deployment deployment); static void sendDeploymentContextualizedMessage(String applicationName, Deployment deployment); static void sendDeploymentDeployingMessage(String applicationName, Deployment deployment); static void sendDeploymentDeployedMessage(String applicationName, Deployment deployment); static void sendDeploymentDeletedMessage(String applicationName, Deployment deployment); static void sendDeploymentErrorMessage(String applicationName, Deployment deployment); static void sendVMDeployingMessage(String applicationName, Deployment deployment, VM vm); static void sendVMDeployedMessage(String applicationName, Deployment deployment, VM vm); static void sendVMDeletedMessage(String applicationName, Deployment deployment, VM vm); static void sendDeploymentRenegotiatingMessage(String applicationName, Deployment deployment); static void sendDeploymentRenegotiatedMessage(String applicationName, Deployment deployment); static final String APPLLICATION_PATH; static final String DEPLOYMENT_PATH; static final String VM_PATH; static final String DELETED; }### Answer:
@Test public void sendVMDeletedMessageTest() throws Exception { AmqpMessageReceiver receiver = new AmqpMessageReceiver(Configuration.amqpAddress, Configuration.amqpUsername, Configuration.amqpPassword, "APPLICATION.pepito.DEPLOYMENT.23.VM.44.DELETED", true); AmqpBasicListener listener = new AmqpBasicListener(); receiver.setMessageConsumer(listener); Deployment deployment = new Deployment(); deployment.setId(23); deployment.setStatus("DELETED"); VM vmToTheMessage = new VM(); vmToTheMessage.setId(44); vmToTheMessage.setHref("href4"); vmToTheMessage.setOvfId("ovfId4"); vmToTheMessage.setProviderId("provider-id4"); vmToTheMessage.setProviderVmId("provider-vm-id4"); vmToTheMessage.setStatus("XXX4"); vmToTheMessage.setIp("172.0.0.14"); vmToTheMessage.setSlaAgreement("slaAggrementId4"); AmqpProducer.sendVMDeletedMessage("pepito", deployment, vmToTheMessage); Thread.sleep(700l); assertEquals("APPLICATION.pepito.DEPLOYMENT.23.VM.44.DELETED", listener.getDestination()); ApplicationManagerMessage amMessageReceived = ModelConverter.jsonToApplicationManagerMessage(listener.getMessage()); assertEquals("pepito", amMessageReceived.getApplicationId()); assertEquals("23", amMessageReceived.getDeploymentId()); assertEquals("DELETED", amMessageReceived.getStatus()); assertEquals(1, amMessageReceived.getVms().size()); assertEquals("provider-vm-id4", amMessageReceived.getVms().get(0).getIaasVmId()); assertEquals("ovfId4", amMessageReceived.getVms().get(0).getOvfId()); assertEquals("XXX4", amMessageReceived.getVms().get(0).getStatus()); assertEquals("44", amMessageReceived.getVms().get(0).getVmId()); receiver.close(); }