@Test public void testFalseCondition() { Properties properties = new Properties(); Packet packet = Packets.getInstance("111", "xml", "aaaa", properties); boolean success = processor.checkCondition(packet); Assert.assertTrue(!success); }
@Test public void testFalseProcessor() { Properties properties = new Properties(); Packet packet = Packets.getInstance("111", "xml", "aaaa", properties); processor.process(packet); Assert.assertTrue(packet.getProperties().containsKey("BBB")); Assert.assertEquals("failed", packet.getProperties().get("BBB")); }
@Test public void testTrueProcessor() { Properties properties = new Properties(); properties.put("test", "blah blah"); Packet packet = Packets.getInstance("111", "xml", "aaaa", properties); processor.process(packet); Assert.assertTrue(packet.getProperties().containsKey("AAA")); Assert.assertEquals("passed", packet.getProperties().get("AAA")); }