@Test
public void testDeliveryListener_success() throws CoapException {

    ObservationTest.SyncObservationListener obsListener = new ObservationTest.SyncObservationListener();
    assertNotNull(client.resource("/obs").sync().observe(obsListener));
    NotificationDeliveryListener delivListener = mock(NotificationDeliveryListener.class);
    obsResource.setBody("A", delivListener);
    verify(delivListener, timeout(3000)).onSuccess(any(InetSocketAddress.class));
    obsResource.setBody("B", delivListener);
    verify(delivListener, timeout(3000).times(2)).onSuccess(any(InetSocketAddress.class));
    verify(delivListener, never()).onFail(any(InetSocketAddress.class));
    verify(delivListener, never()).onNoObservers();
}