AbstractRegistrationService implements RegistrationService { @Override public final Future<RegistrationResult> assertRegistration(final String tenantId, final String deviceId) { return assertRegistration(tenantId, deviceId, NoopSpan.INSTANCE); }  @Autowired(required = false) final void setTenantInformationService(final TenantInformationService tenantInformationService); @Override final Future<RegistrationResult> assertRegistration(final String tenantId, final String deviceId); @Override Future<RegistrationResult> assertRegistration(final String tenantId, final String deviceId, final Span span); @Override final Future<RegistrationResult> assertRegistration(final String tenantId, final String deviceId, final String gatewayId); @Override Future<RegistrationResult> assertRegistration(final String tenantId, final String deviceId, final String gatewayId, final Span span); static final int DEFAULT_MAX_AGE_SECONDS; }
@Test public void testAssertRegistrationFailsForNonExistingTenant(final VertxTestContext ctx) { when(tenantInformationService.tenantExists(anyString(), any(Span.class))) .thenReturn(Future.succeededFuture(Result.from(HttpURLConnection.HTTP_NOT_FOUND))); service.assertRegistration(Constants.DEFAULT_TENANT, "device", span) .onComplete(ctx.succeeding(result -> { ctx.verify(() -> { assertThat(result.getStatus()).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND); }); ctx.completeNow(); })); }