Search in sources :

Example 1 with TolkienCharacter

use of org.assertj.core.data.TolkienCharacter in project assertj-core by joel-costigliola.

the class BaseAssumptionsRunnerTest method setupData.

private static void setupData() {
    bart = new CartoonCharacter("Bart Simpson");
    lisa = new CartoonCharacter("Lisa Simpson");
    maggie = new CartoonCharacter("Maggie Simpson");
    homer = new CartoonCharacter("Homer Simpson");
    homer.getChildren().add(bart);
    homer.getChildren().add(lisa);
    homer.getChildren().add(maggie);
    CartoonCharacter pebbles = new CartoonCharacter("Pebbles Flintstone");
    fred = new CartoonCharacter("Fred Flintstone");
    fred.getChildren().add(pebbles);
    throwingNameExtractor = TolkienCharacter::getName;
    throwingAgeExtractor = TolkienCharacter::getAge;
    nameExtractor = TolkienCharacter::getName;
    ageExtractor = TolkienCharacter::getAge;
    nameExtractorFunction = TolkienCharacter::getName;
    ageExtractorFunction = TolkienCharacter::getAge;
    frodo = TolkienCharacter.of("Frodo", 33, Race.HOBBIT);
    sam = TolkienCharacter.of("Sam", 35, Race.HOBBIT);
    childrenExtractor = CartoonCharacter::getChildren;
}
Also used : CartoonCharacter(org.assertj.core.test.CartoonCharacter) TolkienCharacter(org.assertj.core.data.TolkienCharacter)

Example 2 with TolkienCharacter

use of org.assertj.core.data.TolkienCharacter in project assertj-core by joel-costigliola.

the class OptionalAssert_get_Test method should_pass_when_optional_contains_a_value.

@Test
public void should_pass_when_optional_contains_a_value() {
    TolkienCharacter frodo = TolkienCharacter.of("Frodo", 33, Race.HOBBIT);
    assertThat(Optional.of(frodo)).get().hasNoNullFieldsOrProperties();
}
Also used : TolkienCharacter(org.assertj.core.data.TolkienCharacter) Test(org.junit.Test) BaseTest(org.assertj.core.api.BaseTest)

Aggregations

TolkienCharacter (org.assertj.core.data.TolkienCharacter)2 BaseTest (org.assertj.core.api.BaseTest)1 CartoonCharacter (org.assertj.core.test.CartoonCharacter)1 Test (org.junit.Test)1