@Test public void setPath_shouldThrowAnException_givenAPathThatIsADirectory() throws Exception { Path directory = Paths.get(System.getProperty("java.io.tmpdir")); assertTrue("precondition: must be a directory", Files.isDirectory(directory)); try { factory.setPath(directory); fail("Expected an exception"); } catch (IllegalArgumentException expected) { assertThat(expected.getMessage(), containsString("must not be a directory")); } }
public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; } }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }  }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }  OpsLoggerFactory setDestination(PrintStream printStream); OpsLoggerFactory setPath(Path path); OpsLoggerFactory setStoreStackTracesInFilesystem(boolean store); OpsLoggerFactory setStackTraceStoragePath(Path directory); OpsLoggerFactory setErrorHandler(Consumer<Throwable> handler); @Deprecated OpsLoggerFactory setCorrelationIdSupplier(Supplier<Map<String,String>> supplier); OpsLoggerFactory setGlobalDiagnosticContextSupplier(DiagnosticContextSupplier supplier); OpsLoggerFactory setAsync(boolean async); @SuppressWarnings("unchecked") OpsLogger<T> build(); }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }  OpsLoggerFactory setDestination(PrintStream printStream); OpsLoggerFactory setPath(Path path); OpsLoggerFactory setStoreStackTracesInFilesystem(boolean store); OpsLoggerFactory setStackTraceStoragePath(Path directory); OpsLoggerFactory setErrorHandler(Consumer<Throwable> handler); @Deprecated OpsLoggerFactory setCorrelationIdSupplier(Supplier<Map<String,String>> supplier); OpsLoggerFactory setGlobalDiagnosticContextSupplier(DiagnosticContextSupplier supplier); OpsLoggerFactory setAsync(boolean async); @SuppressWarnings("unchecked") OpsLogger<T> build();  }