@Test public void getTeamname() throws Exception { String id = ""; Map<String, String> props = new HashMap<>(); DroneInstance instance = new DroneInstance(id); MockDiscoverer discoverer = spy(new MockDiscoverer()); MockDiscoveryStoredNode node = new MockDiscoveryStoredNode(id, props); doReturn(node).when(discoverer).getNode(any()); Assert.assertEquals(DroneInstance.getTeamname(discoverer, id), null); String teamname = "test_team"; props.put("team", teamname); Assert.assertEquals(DroneInstance.getTeamname(discoverer, id), teamname); }
public static String getTeamname(Discoverer discoverer, String id){ return discoverer.getNode(new DroneInstance(id)).getValues().getOrDefault("team", null); }
DroneInstance extends Instance { public static String getTeamname(Discoverer discoverer, String id){ return discoverer.getNode(new DroneInstance(id)).getValues().getOrDefault("team", null); } }
DroneInstance extends Instance { public static String getTeamname(Discoverer discoverer, String id){ return discoverer.getNode(new DroneInstance(id)).getValues().getOrDefault("team", null); } DroneInstance(String id);  DroneInstance(String id, Map<String, String> properties); }
DroneInstance extends Instance { public static String getTeamname(Discoverer discoverer, String id){ return discoverer.getNode(new DroneInstance(id)).getValues().getOrDefault("team", null); } DroneInstance(String id);  DroneInstance(String id, Map<String, String> properties); static String getTeamname(Discoverer discoverer, String id); }
DroneInstance extends Instance { public static String getTeamname(Discoverer discoverer, String id){ return discoverer.getNode(new DroneInstance(id)).getValues().getOrDefault("team", null); } DroneInstance(String id);  DroneInstance(String id, Map<String, String> properties); static String getTeamname(Discoverer discoverer, String id);  }