LogDirectory { public static String circleAwareLogDirectory(Class<?> testClass) { return circleAwareLogDirectory(testClass.getSimpleName()); } private  LogDirectory(); static String circleAwareLogDirectory(Class<?> testClass); static String circleAwareLogDirectory(String logDirectoryName); static String gradleDockerLogsDirectory(Class<?> testClass);  }
@Test public void circleAwareLogDirectory_should_match_gradleDockerLogsDirectory_by_default() { variablesRule.set("CIRCLE_ARTIFACTS", null); String directory = LogDirectory.circleAwareLogDirectory(SomeTestClass.class); assertThat(directory, is("build/dockerLogs/SomeTestClass")); }
@Test public void circleAwareLogDirectory_should_use_circle_environment_variable_if_available() { variablesRule.set("CIRCLE_ARTIFACTS", "/tmp/circle-artifacts.g4DjuuD"); String directory = LogDirectory.circleAwareLogDirectory(SomeTestClass.class); assertThat(directory, is("/tmp/circle-artifacts.g4DjuuD/dockerLogs/SomeTestClass")); }
@Test public void circleAwareLogDirectory_should_append_logDirectoryName_to_path() { variablesRule.set("CIRCLE_ARTIFACTS", "/tmp/circle-artifacts.123456"); String directory = LogDirectory.circleAwareLogDirectory("some-path"); assertThat(directory, is("/tmp/circle-artifacts.123456/dockerLogs/some-path")); }