PurgeEntitiesResponse extends CommonCommandResponse<PurgeEntitiesResponse> { public static PurgeEntitiesResponse failed(final EntityType entityType, final DittoHeaders dittoHeaders) { return new PurgeEntitiesResponse(entityType, false, dittoHeaders); } private  PurgeEntitiesResponse(final EntityType entityType, final boolean successful,
            final DittoHeaders dittoHeaders); static PurgeEntitiesResponse successful(final EntityType entityType, final DittoHeaders dittoHeaders); static PurgeEntitiesResponse failed(final EntityType entityType, final DittoHeaders dittoHeaders); static PurgeEntitiesResponse fromJson(final JsonObject jsonObject, final DittoHeaders headers); EntityType getEntityType(); boolean isSuccessful(); @Override PurgeEntitiesResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void failedResponseToJson() { final JsonObject expectedJson = KNOWN_JSON.toBuilder() .set(PurgeEntitiesResponse.JsonFields.SUCCESSFUL, false) .build(); final PurgeEntitiesResponse underTest = PurgeEntitiesResponse.failed(ENTITY_TYPE, HEADERS); DittoJsonAssertions.assertThat(underTest.toJson()).isEqualTo(expectedJson); }