Search in sources :

Example 1 with StringAssert

use of org.assertj.core.api.StringAssert in project zeebe-process-test by camunda.

the class IncidentAssert method extractingErrorMessage.

/**
 * Extracts the error message for further assertions
 *
 * @return {@link StringAssert} of error message
 */
public StringAssert extractingErrorMessage() {
    final IncidentRecordValue record = getIncidentCreatedRecordValue();
    final String actualErrorMessage = record.getErrorMessage();
    return new StringAssert(actualErrorMessage);
}
Also used : IncidentRecordValue(io.camunda.zeebe.protocol.record.value.IncidentRecordValue) StringAssert(org.assertj.core.api.StringAssert)

Example 2 with StringAssert

use of org.assertj.core.api.StringAssert in project assertj-core by joel-costigliola.

the class IterableAssert_first_Test method should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory.

@Test
void should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory() {
    // GIVEN
    AssertFactory<String, StringAssert> assertFactory = StringAssert::new;
    // WHEN
    StringAssert result = assertThat(iterable, assertFactory).first();
    // THEN
    result.startsWith("Hom");
}
Also used : StringAssert(org.assertj.core.api.StringAssert) Test(org.junit.jupiter.api.Test)

Example 3 with StringAssert

use of org.assertj.core.api.StringAssert in project assertj-core by joel-costigliola.

the class IterableAssert_element_Test method should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory.

@Test
void should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory() {
    // GIVEN
    AssertFactory<String, StringAssert> assertFactory = StringAssert::new;
    // WHEN
    StringAssert result = assertThat(iterable, assertFactory).element(1);
    // THEN
    result.startsWith("Mar");
}
Also used : StringAssert(org.assertj.core.api.StringAssert) Test(org.junit.jupiter.api.Test)

Example 4 with StringAssert

use of org.assertj.core.api.StringAssert in project assertj-core by joel-costigliola.

the class IterableAssert_singleElement_Test method should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory.

@Test
void should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory() {
    // GIVEN
    AssertFactory<String, StringAssert> assertFactory = StringAssert::new;
    // WHEN
    StringAssert result = assertThat(babySimpsons, assertFactory).singleElement();
    // THEN
    result.startsWith("Mag");
}
Also used : StringAssert(org.assertj.core.api.StringAssert) Test(org.junit.jupiter.api.Test)

Example 5 with StringAssert

use of org.assertj.core.api.StringAssert in project assertj-core by assertj.

the class IterableAssert_singleElement_Test method should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory.

@Test
void should_pass_allowing_type_narrowed_assertions_if_assertion_was_created_with_assert_factory() {
    // GIVEN
    AssertFactory<String, StringAssert> assertFactory = StringAssert::new;
    // WHEN
    StringAssert result = assertThat(babySimpsons, assertFactory).singleElement();
    // THEN
    result.startsWith("Mag");
}
Also used : StringAssert(org.assertj.core.api.StringAssert) Test(org.junit.jupiter.api.Test)

Aggregations

StringAssert (org.assertj.core.api.StringAssert)18 Test (org.junit.jupiter.api.Test)16 IncidentRecordValue (io.camunda.zeebe.protocol.record.value.IncidentRecordValue)2