PurgeNamespaceResponse extends AbstractNamespaceCommandResponse<PurgeNamespaceResponse> { public static PurgeNamespaceResponse failed(final CharSequence namespace, final CharSequence resourceType, final DittoHeaders dittoHeaders) { return new PurgeNamespaceResponse(namespace, resourceType, false, dittoHeaders); } private  PurgeNamespaceResponse(final CharSequence namespace,
            final CharSequence resourceType,
            final boolean successful,
            final DittoHeaders dittoHeaders); static PurgeNamespaceResponse successful(final CharSequence namespace, final CharSequence resourceType,
            final DittoHeaders dittoHeaders); static PurgeNamespaceResponse failed(final CharSequence namespace, final CharSequence resourceType,
            final DittoHeaders dittoHeaders); static PurgeNamespaceResponse fromJson(final JsonObject jsonObject, final DittoHeaders headers); boolean isSuccessful(); @Override PurgeNamespaceResponse 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 = knownJsonRepresentation.toBuilder() .set(PurgeNamespaceResponse.JsonFields.SUCCESSFUL, false) .build(); final PurgeNamespaceResponse underTest = PurgeNamespaceResponse.failed(NAMESPACE, RESOURCE_TYPE, dittoHeaders); assertThat(underTest.toJson()).isEqualTo(expectedJson); }
@Test public void getIdReturnsNamespace() { final PurgeNamespaceResponse underTest = PurgeNamespaceResponse.failed(NAMESPACE, RESOURCE_TYPE, dittoHeaders); assertThat(underTest.getId()).isEqualTo(underTest.getNamespace()); }