### Question:
ChainBootstrapper { private void registerTransactionsToMonitor(Iterable<TransactionMonitoringSpec> specs, boolean broadcast) { if (specs != null) { specs.forEach(spec -> registerTransactionToMonitor(spec, broadcast)); } }  @EventListener void onApplicationEvent(ContextRefreshedEvent event);  }### Answer:
@Test public void testThatTransactionsMonitorsAreRegistered() throws Exception { final List<TransactionMonitoringSpec> mockMonitorSpecs = Arrays.asList(mock(TransactionMonitoringSpec.class), mock(TransactionMonitoringSpec.class)); when(mockTransactionMonitoringRepository.findAll()).thenReturn(mockMonitorSpecs); doBootstrap(); verify(mockTransactionMonitoringService, times(1)).registerTransactionsToMonitor(mockMonitorSpecs.get(0), true); verify(mockTransactionMonitoringService, times(1)).registerTransactionsToMonitor(mockMonitorSpecs.get(1), true); }
@Test public void testThatContractTransactionFiltersAreRegistered() throws Exception { final List<TransactionMonitoringSpec> mockConfiguredFilters = Arrays.asList(mock(TransactionMonitoringSpec.class), mock(TransactionMonitoringSpec.class)); when(transactionFilterConfiguration.getConfiguredTransactionFilters()).thenReturn(mockConfiguredFilters); doBootstrap(); verify(mockTransactionMonitoringService, times(1)).registerTransactionsToMonitor(mockConfiguredFilters.get(0), true); verify(mockTransactionMonitoringService, times(1)).registerTransactionsToMonitor(mockConfiguredFilters.get(1), true); }