### Question:
RuleCapabilitiesServiceImpl implements RuleCapabilitiesService { @Override public void startScanner(final ContainerSpecKey containerSpecKey, final Long interval) { ServerTemplate serverTemplate = templateStorage.load(containerSpecKey.getServerTemplateKey().getId()); if (serverTemplate == null) { throw new KieServerControllerIllegalArgumentException("No server template found for id " + containerSpecKey.getServerTemplateKey().getId()); } ContainerSpec containerSpec = serverTemplate.getContainerSpec(containerSpecKey.getId()); if (containerSpec == null) { throw new KieServerControllerIllegalArgumentException("No container spec found for id " + containerSpecKey.getId()); } ContainerConfig containerConfig = containerSpec.getConfigs().get(Capability.RULE); if (containerConfig == null) { containerConfig = new RuleConfig(); containerSpec.getConfigs().put(Capability.RULE, containerConfig); } ((RuleConfig) containerConfig).setPollInterval(interval); ((RuleConfig) containerConfig).setScannerStatus(KieScannerStatus.STARTED); templateStorage.update(serverTemplate); List<Container> containers = kieServerInstanceManager.startScanner(serverTemplate, containerSpec, interval); notificationService.notify(serverTemplate, containerSpec, containers); }  @Override void scanNow(final ContainerSpecKey containerSpecKey); @Override void startScanner(final ContainerSpecKey containerSpecKey,
                             final Long interval); @Override void stopScanner(final ContainerSpecKey containerSpecKey); @Override void upgradeContainer(final ContainerSpecKey containerSpecKey,
                                 ReleaseId releaseId); KieServerTemplateStorage getTemplateStorage(); void setTemplateStorage(KieServerTemplateStorage templateStorage); KieServerInstanceManager getKieServerInstanceManager(); void setKieServerInstanceManager(KieServerInstanceManager kieServerInstanceManager); NotificationService getNotificationService(); void setNotificationService(NotificationService notificationService);  }### Answer:
@Test public void testStartScanner() { List<Container> fakeResult = new ArrayList<Container>(); fakeResult.add(container); when(kieServerInstanceManager.startScanner(any(ServerTemplate.class), any(ContainerSpec.class), anyLong())).thenReturn(fakeResult); ruleCapabilitiesService.startScanner(containerSpec, 100l); verify(kieServerInstanceManager, times(1)).startScanner(any(ServerTemplate.class), any(ContainerSpec.class), anyLong()); ServerTemplate updated = specManagementService.getServerTemplate(serverTemplate.getId()); Collection<ContainerSpec> containerSpecs = updated.getContainersSpec(); assertNotNull(containerSpecs); assertEquals(1, containerSpecs.size()); ContainerSpec updatedContainer = containerSpecs.iterator().next(); assertNotNull(updatedContainer); ContainerConfig ruleConfig = updatedContainer.getConfigs().get(Capability.RULE); assertNotNull(ruleConfig); assertTrue(ruleConfig instanceof RuleConfig); RuleConfig ruleCg = (RuleConfig) ruleConfig; assertEquals(KieScannerStatus.STARTED, ruleCg.getScannerStatus()); assertEquals(100l, ruleCg.getPollInterval().longValue()); }