### Question:
TrackingInfoUtils { public static JsonObject getConfigUpdateInfo(String option, String newValue) { LoggingService.logInfo(MODULE_NAME, "Start getting config update information"); JsonObject info = null; if (option != null && newValue != null){ info = Json.createObjectBuilder() .add(option, newValue) .build(); } else { LoggingService.logError(MODULE_NAME, "can't update config info : option or value must not be null", new AgentSystemException("can't update config info : option or value must not be null")); info = Json.createObjectBuilder() .add("error", "can't update config info : option or value must not be null") .build(); } LoggingService.logInfo(MODULE_NAME, "Finished getting config update information"); return info; }  static JsonObject getStartTrackingInfo(); static JsonObject getConfigUpdateInfo(String option, String newValue); static JsonObject getMicroservicesInfo(JsonArray microservices);  }### Answer:
@Test public void testGetConfigUpdateInfo() { assertTrue(TrackingInfoUtils.getConfigUpdateInfo("option", "value").containsKey("option")); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Start getting config update information"); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Finished getting config update information"); }
@Test public void throwsExceptionWhenOptionISNull() { assertTrue(TrackingInfoUtils.getConfigUpdateInfo(null, "value").containsKey("error")); assertTrue(TrackingInfoUtils.getConfigUpdateInfo("option", null).containsKey("error")); assertFalse(TrackingInfoUtils.getConfigUpdateInfo(null, "value").containsKey("option")); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Start getting config update information"); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logError(eq(MODULE_NAME), eq("can't update config info : option or value must not be null"), any()); PowerMockito.verifyStatic(LoggingService.class, Mockito.atLeastOnce()); LoggingService.logInfo(MODULE_NAME, "Finished getting config update information"); }