@Test public void build_shouldConstructACorrectlyConfiguredBasicOpsLogger() throws Exception { BasicOpsLogger<TestMessages> result = factory.build(infrastructure); assertEquals(Clock.systemUTC(), result.getClock()); assertSame(expectedDiagnosticContextSupplier, result.getDiagnosticContextSupplier()); assertSame(expectedDestination, result.getDestination()); assertNotNull(result.getLock()); assertThat(result.getLock(), instanceOf(ReentrantLock.class)); assertSame(expectedErrorHandler, result.getErrorHandler()); }
public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); } }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }  }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }  BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory); }
BasicOpsLoggerFactory { public <T extends Enum<T> & LogMessage> BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory) { DiagnosticContextSupplier correlationIdSupplier = infrastructureFactory.configureContextSupplier(); Consumer<Throwable> errorHandler = infrastructureFactory.configureErrorHandler(); Destination<T> destination = infrastructureFactory.configureDestination(); return new BasicOpsLogger<>(Clock.systemUTC(), correlationIdSupplier, destination, new ReentrantLock(), errorHandler); }  BasicOpsLogger<T> build(InfrastructureFactory infrastructureFactory);  }