### Question:
ServiceBuildPropertiesContainer { public static void logServiceBuildString(Logger logger) { logServiceBuildString(logger, true); }  static void logServiceBuildString(Logger logger); static void logServiceBuildString(Logger logger, boolean throwExceptionIfMissing); static void setBuildPropertyReader(BuildPropertiesReader buildPropertyReader); final static String BUILD_PROPERTIES_FILE; }### Answer:
@Test public void testLogServiceBuildString() { doReturn(new BuildProperties().setValid(true)).when(mockBuildPropertiesReader).getFirstServiceBuildProperties(); ServiceBuildPropertiesContainer.logServiceBuildString(mockLogger); verify(mockLogger, times(1)).info(anyString()); }
@Test(expectedExceptions = RuntimeException.class) public void testLogServiceBuildStringInvalid() { doReturn(null).when(mockBuildPropertiesReader).getFirstServiceBuildProperties(); ServiceBuildPropertiesContainer.logServiceBuildString(mockLogger); }
@Test public void testLogServiceBuildStringInvalidAllowed() { doReturn(null).when(mockBuildPropertiesReader).getFirstServiceBuildProperties(); ServiceBuildPropertiesContainer.logServiceBuildString(mockLogger, false); }