AcknowledgementRequests { public static ImmutableAcknowledgementRequest parseAcknowledgementRequest( final CharSequence ackRequestRepresentation) { checkNotNull(ackRequestRepresentation, "ackRequestRepresentation"); return newAcknowledgementRequest(tryToParseAcknowledgementLabel(ackRequestRepresentation)); } private  AcknowledgementRequests(); static ImmutableAcknowledgementRequest newAcknowledgementRequest(
            final AcknowledgementLabel acknowledgementLabel); static ImmutableFilteredAcknowledgementRequest newFilteredAcknowledgementRequest(
            final Set<AcknowledgementRequest> includes, @Nullable final String filter); static FilteredAcknowledgementRequest filteredAcknowledgementRequestFromJson(final JsonObject jsonObject); static ImmutableAcknowledgementRequest parseAcknowledgementRequest(
            final CharSequence ackRequestRepresentation);  }
@Test public void tryToParseAcknowledgementRequestFromNull() { assertThatNullPointerException() .isThrownBy(() -> AcknowledgementRequests.parseAcknowledgementRequest(null)) .withMessage("The ackRequestRepresentation must not be null!") .withNoCause(); }
@Test public void tryToParseAcknowledgementRequestFromStringWithInvalidLabel() { final String invalidAckLabel = "ab"; final AcknowledgementLabelInvalidException expectedCause = new AcknowledgementLabelInvalidException(invalidAckLabel); assertThatExceptionOfType(AcknowledgementRequestParseException.class) .isThrownBy(() -> AcknowledgementRequests.parseAcknowledgementRequest(invalidAckLabel)) .withMessageContaining(invalidAckLabel) .withMessageContaining(expectedCause.getMessage()) .withCause(expectedCause); }
@Test public void parseAcknowledgementRequestFromValidStringRepresentation() { final AcknowledgementLabel ackLabel = DittoAcknowledgementLabel.TWIN_PERSISTED; final ImmutableAcknowledgementRequest expected = ImmutableAcknowledgementRequest.getInstance(ackLabel); final ImmutableAcknowledgementRequest actual = AcknowledgementRequests.parseAcknowledgementRequest(ackLabel); assertThat(actual).isEqualTo(expected); }