CredentialsObject extends JsonBackedValueObject { public void checkSecrets() { checkSecrets((secretType, secret) -> {}); } CredentialsObject();  CredentialsObject(
            final String deviceId,
            final String authId,
            final String type); @JsonAnySetter CredentialsObject setProperty(final String name, final Object value); @JsonIgnore String getDeviceId(); @JsonIgnore CredentialsObject setDeviceId(final String deviceId); @JsonIgnore String getType(); @JsonIgnore CredentialsObject setType(final String type); @JsonIgnore String getAuthId(); @JsonIgnore CredentialsObject setAuthId(final String authId); @JsonIgnore boolean isEnabled(); @JsonIgnore CredentialsObject setEnabled(final boolean enabled); @JsonIgnore JsonArray getSecrets(); CredentialsObject addSecret(final JsonObject secret); CredentialsObject addSecret(final Map<String, Object> secret); void checkValidity(); void checkValidity(final BiConsumer<String, JsonObject> secretValidator); void checkSecrets(); void checkSecrets(final BiConsumer<String, JsonObject> secretValidator); @JsonIgnore List<JsonObject> getCandidateSecrets(); @JsonIgnore List<T> getCandidateSecrets(final Function<JsonObject, T> projection); static boolean isInValidityPeriod(final JsonObject secret, final Instant instant); static Instant getNotBefore(final JsonObject secret); static Instant getNotAfter(final JsonObject secret); static JsonObject emptySecret(final Instant notBefore, final Instant notAfter); static CredentialsObject fromHashedPassword(
            final String deviceId,
            final String username,
            final String passwordHash,
            final String hashAlgorithm,
            final Instant notBefore,
            final Instant notAfter,
            final byte[] salt); static CredentialsObject fromClearTextPassword(
            final String deviceId,
            final String username,
            final String clearTextPassword,
            final Instant notBefore,
            final Instant notAfter); static JsonObject hashedPasswordSecretForPasswordHash(
            final String passwordHash,
            final String hashAlgorithm,
            final Instant notBefore,
            final Instant notAfter,
            final byte[] salt); static JsonObject hashedPasswordSecretForPasswordHash(
            final String passwordHash,
            final String hashAlgorithm,
            final Instant notBefore,
            final Instant notAfter,
            final String encodedSalt); static JsonObject hashedPasswordSecretForClearTextPassword(
            final String clearTextpassword,
            final Instant notBefore,
            final Instant notAfter); static CredentialsObject fromPresharedKey(
            final String deviceId,
            final String authId,
            final byte[] key,
            final Instant notBefore,
            final Instant notAfter); static CredentialsObject fromClientCertificate(
            final String deviceId,
            final X509Certificate certificate,
            final Instant notBefore,
            final Instant notAfter); static CredentialsObject fromSubjectDn(
            final String deviceId,
            final X500Principal subjectDn,
            final Instant notBefore,
            final Instant notAfter);  }
@Test public void testCheckSecretsDetectsMissingSecrets() { final CredentialsObject creds = new CredentialsObject("tenant", "device", "x509-cert"); assertThatThrownBy(() -> creds.checkSecrets()).isInstanceOf(IllegalStateException.class); }