@Test public void generateRequestIdWhenJobStarts() { final JobExecutionContext executionContext = mock(JobExecutionContext.class); when(executionContext.getMergedJobDataMap()).thenReturn(new JobDataMap()); unit.jobToBeExecuted(executionContext); assertThat(backend.copyToMap(), Matchers.hasKey(TraceeConstants.INVOCATION_ID_KEY)); verify(backend).put(eq(TraceeConstants.INVOCATION_ID_KEY), anyString()); }
@Override public void jobToBeExecuted(JobExecutionContext context) { final TraceeFilterConfiguration configuration = backend.getConfiguration(profile); if (configuration.shouldProcessContext(AsyncProcess)) { @SuppressWarnings("unchecked") final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER); if (traceeContext != null && !traceeContext.isEmpty()) { final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess); backend.putAll(filteredContext); } } Utilities.generateInvocationIdIfNecessary(backend); }
TraceeJobListener extends JobListenerSupport { @Override public void jobToBeExecuted(JobExecutionContext context) { final TraceeFilterConfiguration configuration = backend.getConfiguration(profile); if (configuration.shouldProcessContext(AsyncProcess)) { @SuppressWarnings("unchecked") final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER); if (traceeContext != null && !traceeContext.isEmpty()) { final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess); backend.putAll(filteredContext); } } Utilities.generateInvocationIdIfNecessary(backend); } }
TraceeJobListener extends JobListenerSupport { @Override public void jobToBeExecuted(JobExecutionContext context) { final TraceeFilterConfiguration configuration = backend.getConfiguration(profile); if (configuration.shouldProcessContext(AsyncProcess)) { @SuppressWarnings("unchecked") final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER); if (traceeContext != null && !traceeContext.isEmpty()) { final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess); backend.putAll(filteredContext); } } Utilities.generateInvocationIdIfNecessary(backend); } TraceeJobListener();  TraceeJobListener(final String profile);   TraceeJobListener(final TraceeBackend backend, final String profile); }
TraceeJobListener extends JobListenerSupport { @Override public void jobToBeExecuted(JobExecutionContext context) { final TraceeFilterConfiguration configuration = backend.getConfiguration(profile); if (configuration.shouldProcessContext(AsyncProcess)) { @SuppressWarnings("unchecked") final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER); if (traceeContext != null && !traceeContext.isEmpty()) { final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess); backend.putAll(filteredContext); } } Utilities.generateInvocationIdIfNecessary(backend); } TraceeJobListener();  TraceeJobListener(final String profile);   TraceeJobListener(final TraceeBackend backend, final String profile); @Override String getName(); @Override void jobToBeExecuted(JobExecutionContext context); @Override void jobExecutionVetoed(JobExecutionContext context); @Override void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException); }
TraceeJobListener extends JobListenerSupport { @Override public void jobToBeExecuted(JobExecutionContext context) { final TraceeFilterConfiguration configuration = backend.getConfiguration(profile); if (configuration.shouldProcessContext(AsyncProcess)) { @SuppressWarnings("unchecked") final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER); if (traceeContext != null && !traceeContext.isEmpty()) { final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess); backend.putAll(filteredContext); } } Utilities.generateInvocationIdIfNecessary(backend); } TraceeJobListener();  TraceeJobListener(final String profile);   TraceeJobListener(final TraceeBackend backend, final String profile); @Override String getName(); @Override void jobToBeExecuted(JobExecutionContext context); @Override void jobExecutionVetoed(JobExecutionContext context); @Override void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException);  }