@Test public void shouldCreateAndConfigureAgent() throws Exception { ZoneConfigurator mockZoneConfigurator = Mockito.mock(ZoneConfigurator.class); EventReporterAgent agent = createEventReporterAgent(mockZoneConfigurator); agent.startAgent(); AgentProperties props = agent.getProperties(); Assert.assertEquals("Push", props.getProperty("adk.messaging.mode")); Assert.assertEquals("http", props.getProperty("adk.messaging.transport")); Assert.assertEquals("30000", props.getProperty("adk.messaging.pullFrequency")); Assert.assertEquals("32000", props.getProperty("adk.messaging.maxBufferSize")); Assert.assertEquals("test.publisher.agent", agent.getId()); TransportManager transportManager = agent.getTransportManager(); Transport transport = transportManager.getTransport("http"); TransportProperties transportProperties = transport.getProperties(); Assert.assertEquals("25101", transportProperties.getProperty("port")); Zone[] allZones = agent.getZoneFactory().getAllZones(); Assert.assertNotNull("Agents zones should not be null", allZones); Assert.assertEquals("Agent should be configured with one zone", 1, allZones.length); Assert.assertNotNull("Agent's zone should not be null", allZones[0]); Assert.assertEquals("Agent's zone Id should be TestZone", "TestZone", allZones[0].getZoneId()); Assert.assertEquals("Agent's zone URL should be http: "http: Mockito.verify(mockZoneConfigurator, Mockito.times(1)).configure(Mockito.any(Zone[].class)); }
public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); }
EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } }
EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } EventReporterAgent();  EventReporterAgent(String id);  EventReporterAgent(String id, ZoneConfigurator zoneConfig, Properties agentProperties,
            Properties httpProperties, Properties httpsProperties, String zoneId,
            String zoneUrl, SIFVersion sifVersion); }
EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } EventReporterAgent();  EventReporterAgent(String id);  EventReporterAgent(String id, ZoneConfigurator zoneConfig, Properties agentProperties,
            Properties httpProperties, Properties httpsProperties, String zoneId,
            String zoneUrl, SIFVersion sifVersion); void startAgent(); void setConfigFilePath(String configFilePath); String getConfigFilePath(); void setZoneConfigurator(ZoneConfigurator zoneConfigurator); ZoneConfigurator getZoneConfigurator(); void setAgentProperties(Properties agentProperties); Properties getAgentProperties(); void setHttpProperties(Properties httpProperties); Properties getHttpProperties(); void setHttpsProperties(Properties httpsProperties); Properties getHttpsProperties(); void setSifVersion(SIFVersion sifVersion); SIFVersion getSifVersion(); }
EventReporterAgent extends Agent { public void startAgent() throws Exception { super.initialize(); setProperties(); Zone[] allZones = getZoneFactory().getAllZones(); zoneConfigurator.configure(allZones); } EventReporterAgent();  EventReporterAgent(String id);  EventReporterAgent(String id, ZoneConfigurator zoneConfig, Properties agentProperties,
            Properties httpProperties, Properties httpsProperties, String zoneId,
            String zoneUrl, SIFVersion sifVersion); void startAgent(); void setConfigFilePath(String configFilePath); String getConfigFilePath(); void setZoneConfigurator(ZoneConfigurator zoneConfigurator); ZoneConfigurator getZoneConfigurator(); void setAgentProperties(Properties agentProperties); Properties getAgentProperties(); void setHttpProperties(Properties httpProperties); Properties getHttpProperties(); void setHttpsProperties(Properties httpsProperties); Properties getHttpsProperties(); void setSifVersion(SIFVersion sifVersion); SIFVersion getSifVersion();  }