use of org.eclipse.gemini.blueprint.mock.MockBundleContext in project motech by motech.
the class MotechOsgiApplicationContextCreatorTest method shouldReturnApplicationOfTypeWebApplicationContext.
@Test
public void shouldReturnApplicationOfTypeWebApplicationContext() throws Exception {
MockBundle bundle = new MockBundle();
MockBundleContext bundleContext = new MockBundleContext(bundle);
ConfigurationScanner configurationScanner = mock(ConfigurationScanner.class);
when(configurationScanner.getConfigurations(bundle)).thenReturn(new String[] { "resource.xml" });
MotechOsgiApplicationContextCreator contextCreator = new MotechOsgiApplicationContextCreator();
contextCreator.setConfigurationScanner(configurationScanner);
MotechOsgiConfigurableApplicationContext applicationContext = (MotechOsgiConfigurableApplicationContext) contextCreator.createApplicationContext(bundleContext);
assertThat(applicationContext, notNullValue());
}
Aggregations