@Test public void build_shouldDelegateToTheBasicOpsLoggerFactory_whenTheDefaultAsyncValueIsUsed() throws Exception { BasicOpsLogger<TestMessages> expectedResult = createMockBasicOpsLogger(); when(basicOpsLoggerFactoryMock.build(Mockito.any())).thenAnswer(invocation -> expectedResult); OpsLogger<TestMessages> result = factory.build(); verify(basicOpsLoggerFactoryMock).build(any(InfrastructureFactory.class)); verifyZeroInteractions(asyncOpsLoggerFactoryMock); assertSame(expectedResult, result); }
@SuppressWarnings("unchecked") public <T extends Enum<T> & LogMessage> OpsLogger<T> build() throws UncheckedIOException { if (!cachedInstance.isPresent()) { cachedInstance = Optional.of(buildNewInstance()); } return (OpsLogger<T>) cachedInstance.get(); }
OpsLoggerFactory { @SuppressWarnings("unchecked") public <T extends Enum<T> & LogMessage> OpsLogger<T> build() throws UncheckedIOException { if (!cachedInstance.isPresent()) { cachedInstance = Optional.of(buildNewInstance()); } return (OpsLogger<T>) cachedInstance.get(); } }
OpsLoggerFactory { @SuppressWarnings("unchecked") public <T extends Enum<T> & LogMessage> OpsLogger<T> build() throws UncheckedIOException { if (!cachedInstance.isPresent()) { cachedInstance = Optional.of(buildNewInstance()); } return (OpsLogger<T>) cachedInstance.get(); }  }
OpsLoggerFactory { @SuppressWarnings("unchecked") public <T extends Enum<T> & LogMessage> OpsLogger<T> build() throws UncheckedIOException { if (!cachedInstance.isPresent()) { cachedInstance = Optional.of(buildNewInstance()); } return (OpsLogger<T>) cachedInstance.get(); }  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 { @SuppressWarnings("unchecked") public <T extends Enum<T> & LogMessage> OpsLogger<T> build() throws UncheckedIOException { if (!cachedInstance.isPresent()) { cachedInstance = Optional.of(buildNewInstance()); } return (OpsLogger<T>) cachedInstance.get(); }  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();  }