### Question:
TrackingInfoUtils { public static JsonObject getStartTrackingInfo() { LoggingService.logInfo(MODULE_NAME, "Start getting tracking information"); JsonObject startInfo = null; try { String gpsCoordinates = Configuration.getGpsCoordinates(); String gpsMode = Configuration.getGpsMode().name(); boolean developerMode = Configuration.isDeveloperMode(); String networkInterface = Configuration.getNetworkInterfaceInfo(); String version = CmdProperties.getVersion(); String agentStatus = StatusReporter.getFieldAgentStatus().getControllerStatus().name().toLowerCase(); startInfo = Json.createObjectBuilder() .add("gpsCoordinates", gpsCoordinates) .add("gpsMode", gpsMode) .add("developerMode", developerMode) .add("networkInterface", networkInterface) .add("version", version) .add("agentStatus", agentStatus) .build(); } catch(Exception e) { LoggingService.logError(MODULE_NAME, "can't parse start config", new AgentSystemException("can't parse start config")); startInfo = Json.createObjectBuilder() .add("error", "can't parse start config") .build(); } LoggingService.logInfo(MODULE_NAME, "Finished getting tracking information"); return startInfo; }  static JsonObject getStartTrackingInfo(); static JsonObject getConfigUpdateInfo(String option, String newValue); static JsonObject getMicroservicesInfo(JsonArray microservices);  }### Answer:
@Test public void testGetStartTrackingInfo() { assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("gpsCoordinates")); assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("gpsMode")); assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("developerMode")); assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("networkInterface")); assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("version")); assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("agentStatus")); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Start getting tracking information"); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Finished getting tracking information"); }
@Test public void throwsExceptionWhenValueIsNull() { when(StatusReporter.getFieldAgentStatus()).thenReturn(null); assertTrue(TrackingInfoUtils.getStartTrackingInfo().containsKey("error")); assertFalse(TrackingInfoUtils.getStartTrackingInfo().containsKey("gpsCoordinates")); assertFalse(TrackingInfoUtils.getStartTrackingInfo().containsKey("gpsMode")); assertFalse(TrackingInfoUtils.getStartTrackingInfo().containsKey("developerMode")); assertFalse(TrackingInfoUtils.getStartTrackingInfo().containsKey("networkInterface")); assertFalse(TrackingInfoUtils.getStartTrackingInfo().containsKey("version")); assertFalse(TrackingInfoUtils.getStartTrackingInfo().containsKey("agentStatus")); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Start getting tracking information"); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logError(eq(MODULE_NAME), eq("can't parse start config"), any()); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Finished getting tracking information"); }