@Autowired public AnalysisController(AnalysisService analysisService, TraceRepository traceRepository, ObjectMapper objectMapper) { this.analysisService = analysisService; this.traceRepository = traceRepository; this.objectMapper = objectMapper; }
public TraceWebFilterAutoConfiguration(TraceRepository traceRepository, TraceProperties traceProperties, ObjectProvider<ErrorAttributes> errorAttributesProvider) { this.traceRepository = traceRepository; this.traceProperties = traceProperties; this.errorAttributes = errorAttributesProvider.getIfAvailable(); }
public EndpointAutoConfiguration( ObjectProvider<HealthAggregator> healthAggregatorProvider, ObjectProvider<Map<String, HealthIndicator>> healthIndicatorsProvider, ObjectProvider<List<InfoContributor>> infoContributorsProvider, ObjectProvider<Collection<PublicMetrics>> publicMetricsProvider, ObjectProvider<TraceRepository> traceRepositoryProvider) { this.healthAggregator = healthAggregatorProvider.getIfAvailable(); this.healthIndicators = healthIndicatorsProvider.getIfAvailable(); this.infoContributors = infoContributorsProvider.getIfAvailable(); this.publicMetrics = publicMetricsProvider.getIfAvailable(); this.traceRepository = traceRepositoryProvider.getIfAvailable(); }
@Test public void skipsIfRepositoryExists() throws Exception { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( Config.class, TraceRepositoryAutoConfiguration.class); assertThat(context.getBeansOfType(InMemoryTraceRepository.class)).isEmpty(); assertThat(context.getBeansOfType(TraceRepository.class)).hasSize(1); context.close(); }
public WebsocketSinkServerHandler(TraceRepository websocketTraceRepository, WebsocketSinkProperties properties, boolean traceEnabled) { this.websocketTraceRepository = websocketTraceRepository; this.properties = properties; this.traceEnabled = traceEnabled; }
@Test public void skipsIfRepositoryExists() throws Exception { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( Config.class, TraceRepositoryAutoConfiguration.class); assertThat(context.getBeansOfType(InMemoryTraceRepository.class).size(), equalTo(0)); assertThat(context.getBeansOfType(TraceRepository.class).size(), equalTo(1)); context.close(); }
@ConditionalOnMissingBean(TraceRepository.class) @Bean public InMemoryTraceRepository traceRepository() { return new InMemoryTraceRepository(); }
/** * Create a new {@link TraceEndpoint} instance. * @param repository the trace repository */ public TraceEndpoint(TraceRepository repository) { super("trace"); Assert.notNull(repository, "Repository must not be null"); this.repository = repository; }
@Bean public TestWebRequestTraceFilter testWebRequestTraceFilter( TraceRepository repository, TraceProperties properties) { return new TestWebRequestTraceFilter(repository, properties); }
TestWebRequestTraceFilter(TraceRepository repository, TraceProperties properties) { super(repository, properties); }
@Bean public TraceRepository traceRepository() { return mock(TraceRepository.class); }
@Bean public TraceEndpoint endpoint() { TraceRepository repository = new InMemoryTraceRepository(); repository.add(Collections.<String, Object>singletonMap("a", "b")); return new TraceEndpoint(repository); }
public WebsocketSinkServerInitializer(TraceRepository traceRepository) { this.traceRepository = traceRepository; }
public WebsocketSinkTraceEndpoint(TraceRepository repository) { super("websocketsinktrace"); this.repository = repository; }