PolicyIdMissingException extends DittoRuntimeException implements ThingException { public static PolicyIdMissingException fromThingIdOnUpdate(final ThingId thingId, final DittoHeaders dittoHeaders) { final JsonSchemaVersion schemaVersion = dittoHeaders.getSchemaVersion().orElse(JsonSchemaVersion.LATEST); return new Builder(thingId, schemaVersion, MESSAGE_TEMPLATE_UPDATE, DEFAULT_DESCRIPTION_UPDATE) .dittoHeaders(dittoHeaders) .build(); } private  PolicyIdMissingException(final DittoHeaders dittoHeaders,
            @Nullable final String message,
            @Nullable final String description,
            @Nullable final Throwable cause,
            @Nullable final URI href); static PolicyIdMissingException fromThingIdOnUpdate(final ThingId thingId, final DittoHeaders dittoHeaders); static PolicyIdMissingException fromThingIdOnCreate(final ThingId thingId, final DittoHeaders dittoHeaders); static PolicyIdMissingException fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override JsonSchemaVersion[] getSupportedSchemaVersions(); static final String ERROR_CODE; }
@Test public void fromThingIdOnUpdate() { final PolicyIdMissingException exception = PolicyIdMissingException.fromThingIdOnUpdate(KNOWN_THING_ID, KNOWN_HEADERS); Assertions.assertThat(exception.getMessage()).contains(KNOWN_THING_ID.toString()); }