### Question:
ProcessDefinitionCheckerImpl implements ProcessDefintionChecker { @Override public void checkBundle(Bundle bundle) { List<URL> pathList = ProcessDefinitionParser.scanForProcesses(bundle); if (!pathList.isEmpty()) { deployer.deployProcessDefinitions(bundle.getSymbolicName(), pathList); } else { LOGGER.log(Level.FINE, "No process found in bundle {}", bundle.getSymbolicName()); } } ProcessDefinitionCheckerImpl();  ProcessDefinitionCheckerImpl(ProcessDefinitionDeployer deployer); @Override void checkBundle(Bundle bundle); @SuppressWarnings("unused") void bundleRemoved(Bundle bundle);  }### Answer:
@Test public void checkBundleWithoutProcesses() { ProcessDefinitionDeployer deployer = mock(ProcessDefinitionDeployer.class); ProcessDefinitionCheckerImpl checker = new ProcessDefinitionCheckerImpl( deployer); Bundle bundle = mock(Bundle.class); when(bundle.getEntry(anyString())).thenReturn(null); when(bundle.getHeaders()).thenReturn(new Hashtable<String, String>()); checker.checkBundle(bundle); }
@SuppressWarnings("unchecked") @Test public void checkBundleWithProcesses() throws MalformedURLException { ProcessDefinitionDeployer deployer = mock(ProcessDefinitionDeployer.class); ProcessDefinitionCheckerImpl checker = new ProcessDefinitionCheckerImpl( deployer); Bundle bundle = mock(Bundle.class); URL url = new URL("file: when(bundle.findEntries(anyString(), anyString(), anyBoolean())).thenReturn(Collections.enumeration(Collections.singletonList(url))); when(bundle.getHeaders()).thenReturn(new Hashtable<String, String>()); when(bundle.getSymbolicName()).thenReturn("org.bundle"); checker.checkBundle(bundle); @SuppressWarnings("rawtypes") ArgumentCaptor<List> captor = ArgumentCaptor.forClass(List.class); verify(deployer).deployProcessDefinitions(eq("org.bundle"), captor.capture()); assertThat((URL) captor.getValue().get(0), is(url)); }