use of com.att.cdp.exceptions.NoProviderFoundException in project AJSC by att.
the class TestContextFactory method testWithPropertiesConfiguration.
/**
* Tests that we can use a properties object to configure the context.
*/
@Test
public void testWithPropertiesConfiguration() {
String dummyPropertyName = "dummyPropertyName";
String dummyPropertyValue = "dummyPropertyValue";
try {
Properties properties = new Properties();
properties.setProperty(dummyPropertyName, dummyPropertyValue);
Context context = ContextFactory.getContext(ProviderName, properties);
assertNotNull(context);
assertTrue(context instanceof DummyProviderContext);
assertNotNull(context.getProperties());
assertTrue(context.getProperties().containsKey(dummyPropertyName));
assertEquals(dummyPropertyValue, context.getProperties().getProperty(dummyPropertyName));
} catch (NoProviderFoundException e) {
fail("We were supposed to find the TestProvider!");
}
}
Aggregations