public ConditionEventsAssert haveOneViolationMessageContaining(Set<String> messageParts) { assertThat(messagesOf(actual.getViolating())).as("Number of violations").hasSize(1); AbstractCharSequenceAssert<?, String> assertion = assertThat(getOnlyElement(messagesOf(actual.getViolating()))); for (String part : messageParts) { assertion.as("Violation message").contains(part); } return this; }
public static AbstractCharSequenceAssert<?, ? extends CharSequence> resultOf(CheckedCharSequenceSupplier whenStep) { return assertThat(result(whenStep)); }
public static AbstractCharSequenceAssert<?, String> resultOf(CheckedStringSupplier whenStep) { return assertThat(result(whenStep)); }
/** * Delegate call to {@link org.assertj.core.api.Assertions#assertThat(String)} */ default AbstractCharSequenceAssert<?, String> then(String actual) { fluentBdd().verification.recordThen(this); return DELEGATE.assertThat(actual); }
/** * Delegate call to {@link org.assertj.core.api.Assertions#assertThat(String)} */ default AbstractCharSequenceAssert<?, String> and(String actual) { fluentBdd().verification.recordThen(this); return DELEGATE.assertThat(actual); }
/** * Delegate call to {@link org.assertj.core.api.Assertions#assertThat(CharSequence)} */ default AbstractCharSequenceAssert<?, ? extends CharSequence> then(CharSequence actual) { fluentBdd().verification.recordThen(this); return DELEGATE.assertThat(actual); }
/** * Delegate call to {@link org.assertj.core.api.Assertions#assertThat(CharSequence)} */ default AbstractCharSequenceAssert<?, ? extends CharSequence> and(CharSequence actual) { fluentBdd().verification.recordThen(this); return DELEGATE.assertThat(actual); }
private AbstractCharSequenceAssert<?, String> assertTextVisibleAtSystemOut() { String log = systemOutRule.getLogWithNormalizedLineSeparator(); int posOfLastCr = log.lastIndexOf("\r"); String visibleText = log.substring(posOfLastCr + 1); return assertThat(visibleText); }
public AbstractCharSequenceAssert<?, String> name() { return Assertions.assertThat(actual.getName()).as(navigationDescription("name")); }
public AbstractCharSequenceAssert<?, String> symbolName() { return Assertions.assertThat(actual.getSymbolName()).as(navigationDescription("symbolName")); }
public AbstractCharSequenceAssert<?, String> symbolName() { return Assertions.assertThat(actual.getSymbolName()); }
/** * Delegate call to public static org.assertj.core.api.AbstractCharSequenceAssert<?, ? extends java.lang.CharSequence> org.assertj.core.api.Assertions.assertThat(java.lang.CharSequence) * {@link org.assertj.core.api.Assertions#assertThat(java.lang.CharSequence)} */ default AbstractCharSequenceAssert<?, ? extends CharSequence> assertThat(CharSequence actual) { return Assertions.assertThat(actual); }
/** * Delegate call to public static org.assertj.core.api.AbstractCharSequenceAssert<?, java.lang.String> org.assertj.core.api.Assertions.assertThat(java.lang.String) * {@link org.assertj.core.api.Assertions#assertThat(java.lang.String)} */ default AbstractCharSequenceAssert<?, String> assertThat(String actual) { return Assertions.assertThat(actual); }
/** * Extract the string value at the given JSON path for further object assertions. * @param expression the {@link JsonPath} expression * @param args arguments to parameterize the {@code JsonPath} expression with, using * formatting specifiers defined in {@link String#format(String, Object...)} * @return a new assertion object whose object under test is the extracted item * @throws AssertionError if the path is not valid or does not result in a string */ public AbstractCharSequenceAssert<?, String> extractingJsonPathStringValue( CharSequence expression, Object... args) { return Assertions.assertThat( extractingJsonPathValue(expression, args, String.class, "a string")); }
/** * A little wrapper over {@code assertThat} that just mention that this what we expect from the test. So if the * expectation fails, it's probably the test that is wrong, not the implementation. * * @param actual actual value * @return an AssertJ assertion */ protected static AbstractCharSequenceAssert<?, String> expect(String actual) { return assertThat(actual); }
/** * Chain assertion on the content of the {@link Optional}. * <p> * Example : * * <pre><code class='java'> Optional<String> optional = Optional.of("Bill"); * * assertThat(optional).extractingCharSequence().startsWith("Bi");</code></pre> * * @return a new {@link AbstractCharSequenceAssert} for assertions chaining on the content of the Optional. * @throws AssertionError if the actual {@link Optional} is {@code null}. * @throws AssertionError if the actual {@link Optional} contains a null instance. */ public AbstractCharSequenceAssert<?, ? extends CharSequence> extractingCharSequence() { isPresent(); assertThat(actual.get()).isInstanceOf(CharSequence.class); return assertThat((CharSequence) actual.get()); }