WorkSlot { public WorkSlot() { } WorkSlot();  WorkSlot(String topo, String boltId); String getTopologyName(); void setTopologyName(String topologyName); String getBoltId(); void setBoltId(String boltId); @Override boolean equals(Object other); @Override int hashCode(); String toString(); public String topologyName; public String boltId; }
@Test public void testWorkSlot() { WorkSlot workSlot = new WorkSlot(); Assert.assertEquals("(null:null)", workSlot.toString()); Assert.assertEquals(null, workSlot.getBoltId()); Assert.assertEquals(null, workSlot.getTopologyName()); workSlot.setBoltId("setBoltId"); workSlot.setTopologyName("setTopologyName"); Assert.assertEquals("(setTopologyName:setBoltId)", workSlot.toString()); Assert.assertEquals("setBoltId", workSlot.getBoltId()); Assert.assertEquals("setTopologyName", workSlot.getTopologyName()); WorkSlot workSlot1 = new WorkSlot("setTopologyName", "setBoltId"); Assert.assertEquals("(setTopologyName:setBoltId)", workSlot1.toString()); Assert.assertEquals("setBoltId", workSlot1.getBoltId()); Assert.assertEquals("setTopologyName", workSlot1.getTopologyName()); Assert.assertTrue(workSlot1.equals(workSlot)); Assert.assertTrue(workSlot1.hashCode() == workSlot.hashCode()); }