}
@Test
public void testCustomFactoryType() throws URISyntaxException {
Registrations reg = new Registrations(new PushRegistrarFactory() {
@Override
public PushRegistrar createPushRegistrar(PushConfig config) {
if (config.getType().getName().equals("CUSTOM_TYPE")) {
return Mockito.mock(PushRegistrar.class);
}
else {
return null;
}
}
});
PushConfig config = new PushConfig(new URI("http://testreg.com"), "TestID");
config.setType(new PushType() {
@Override
public String getName() {
return "CUSTOM_TYPE";
}
});
assertNotNull(reg.push(PUSH, config));
}