@Test public void build_shouldConstructACorrectlyConfiguredAsyncOpsLogger() throws Exception { AsyncOpsLogger<TestMessages> result = factory.build(infrastructure); assertEquals(Clock.systemUTC(), result.getClock()); assertSame(expectedDiagnosticContextSupplier, result.getDiagnosticContextSupplier()); assertSame(expectedDestination, result.getDestination()); assertSame(expectedErrorHandler, result.getErrorHandler()); assertNotNull(result.getTransferQueue()); verify(mockAsyncExecutor).execute(any(Runnable.class)); }
public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); } }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory); }
AsyncOpsLoggerFactory { public <T extends Enum<T> & LogMessage> AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier diagnosticContextSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new AsyncOpsLogger<>(Clock.systemUTC(), diagnosticContextSupplier, destination, errorHandler, new LinkedTransferQueue<>(), asyncExecutor); }  AsyncOpsLogger<T> build(InfrastructureFactory infrastructureFactory);  }