use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class QueuedApnsServiceTest method pushEventually.
@Test
public void pushEventually() {
ConnectionStub connection = spy(new ConnectionStub(0, 1));
ApnsService service = newService(connection, null);
service.push(notification);
connection.semaphore.acquireUninterruptibly();
verify(connection, times(1)).sendMessage(notification);
}
use of com.notnoop.apns.ApnsService in project java-apns by notnoop.
the class ApnsServiceImplTest method pushEventually.
@Test
public void pushEventually() {
ApnsConnection connection = mock(ApnsConnection.class);
ApnsService service = newService(connection, null);
service.push(notification);
verify(connection, times(1)).sendMessage(notification);
}
use of com.notnoop.apns.ApnsService in project camel by apache.
the class ApnsServiceFactory method getApnsService.
public ApnsService getApnsService() {
ApnsServiceBuilder builder = APNS.newService();
builder = configureServiceBuilder(builder);
configureConnectionStrategy(builder);
configureReconnectionPolicy(builder);
configureApnsDelegate(builder);
configureApnsDestinations(builder);
try {
configureApnsCertificate(builder);
} catch (IOException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
} catch (GeneralSecurityException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
ApnsService apnsService = builder.build();
return apnsService;
}
use of com.notnoop.apns.ApnsService in project camel by apache.
the class ApnsProducerTest method createCamelContext.
protected CamelContext createCamelContext() throws Exception {
CamelContext camelContext = super.createCamelContext();
ApnsServiceFactory apnsServiceFactory = ApnsUtils.createDefaultTestConfiguration(camelContext);
ApnsService apnsService = apnsServiceFactory.getApnsService();
ApnsComponent apnsComponent = new ApnsComponent(apnsService);
camelContext.addComponent("apns", apnsComponent);
return camelContext;
}
use of com.notnoop.apns.ApnsService in project camel by apache.
the class ApnsServiceFactoryTest method testApnsServiceFactoryWithFixedCertificates.
@Test
public void testApnsServiceFactoryWithFixedCertificates() throws Exception {
ApnsServiceFactory apnsServiceFactory = createApnsServiceFactoryWithFixedCertificates();
ApnsService apnsService = apnsServiceFactory.getApnsService();
doBasicAsserts(apnsService);
}
Aggregations