### Question:
SpreaderBean implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { logger.info("Initializing the Spreader IaaS Monitoring Bean"); try { PRClient prClient = new PRClient(); List<Provider> providers = prClient.getProviders(); for(Provider provider : providers) { MetricsListener listener = new MetricsListener(provider.getAmqpUrl(), topic , "" + provider.getId(), vmDAO); logger.info("Creating listener for provider: " + provider.getId() + " provider amqp: " + provider.getAmqpUrl()); listeners.put("" + provider.getId(), listener); } } catch(Exception ex) { System.out.println("Error creating spreading bean..."); } } SpreaderBean(); @Override void afterPropertiesSet();  }### Answer:
@Test public void constructorTest() throws Exception { Configuration.providerRegistryEndpoint = mBaseURL; String collection = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" + "<collection xmlns=\"http: "<items offset=\"0\" total=\"1\">" + "<provider href=\"/1\">" + "<id>1</id>" + "<name>default</name>" + "<vmm-url>http: "<slam-url>http: "<amqp-url>amqp: "<link rel=\"parent\" href=\"/\" type=\"application/xml\"/>" + "<link rel=\"self\" href=\"/1\" type=\"application/xml\"/>" + "</provider>" + "<provider href=\"/1\">" + "<id>2</id>" + "<name>default</name>" + "<vmm-url>http: "<slam-url>http: "<amqp-url>amqp: "<link rel=\"parent\" href=\"/\" type=\"application/xml\"/>" + "<link rel=\"self\" href=\"/1\" type=\"application/xml\"/>" + "</provider>" + "</items>" + "<link rel=\"self\" href=\"/\" type=\"application/xml\"/>" + "</collection>"; mServer.addPath("/", collection); SpreaderBean spreaderBean = new SpreaderBean(); spreaderBean.afterPropertiesSet(); assertEquals(2, spreaderBean.listeners.keySet().size()); }