@org.junit.Test public void testGetPhysicalHost() throws Exception { when(node.getNodeId()).thenReturn(nodeId); when(node.getNodeId().getValue()) .thenReturn(new String("00001111-0000-0000-0000-000011112222")); physicalHostId = new PhysicalHostId(node.getNodeId().getValue()); // into getPhysicalHost when(physicalHost.getHostId()).thenReturn(physicalHostId); Assert.assertEquals(intentResolverUtils.getPhysicalHost(physicalHostList, node), physicalHost); }