@Test
public void testRemoveCredentialsByDeviceSucceeds(final TestContext ctx) {
register(getCompleteCredentialsService(), "tenant", "device", "myId", "myType", ctx);
register(getCompleteCredentialsService(), "tenant", "device", "myOtherId", "myOtherType", ctx);
register(getCompleteCredentialsService(), "tenant", "other-device", "thirdId", "myType", ctx);
final Async remove = ctx.async();
getCompleteCredentialsService().removeAll("tenant", "device", ctx.asyncAssertSuccess(s -> {
assertThat(s.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT));
assertNotRegistered(getCompleteCredentialsService(), "tenant", "myId", "myType", ctx);
assertNotRegistered(getCompleteCredentialsService(), "tenant", "myOtherId", "myOtherType", ctx);
assertRegistered(getCompleteCredentialsService(), "tenant", "thirdId", "myType", ctx);
remove.complete();
}));
remove.await();
}