/** * Build a string representing a navigation from given assert to given property name. */ static String navigationDescription(AbstractAssert<?, ?> as, String propertyName) { String text = as.descriptionText(); if (Strings.isNullOrEmpty(text)) { text = removeAssert(as.getClass().getSimpleName()); } return text + " " + propertyName; }
@Test public void should_delegate_to_overridingErrorMessage() { AbstractAssert<?, ?> suT = spy(Assertions.assertThat("test")); suT.withFailMessage("test", "eins"); verify(suT).overridingErrorMessage("test", "eins"); }
public static AbstractAssert<?, IExecutionGraph> assertThat(IExecutionGraph actual) { return new ExecutionGraphAssert(actual, ExecutionGraphAssert.class); }
/** * Helper for list assertions. */ static <ELEMENT, ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>> ExtListAssert<ELEMENT_ASSERT, ELEMENT> assertThat( List<? extends ELEMENT> actual, Class<ELEMENT_ASSERT> assertClass, String description) { return (ExtListAssert<ELEMENT_ASSERT, ELEMENT>) new ExtListAssert<ELEMENT_ASSERT, ELEMENT>(actual, assertClass) .as(description); }
@Test @SuppressWarnings("deprecation") public void should_not_fail_when_equals_exceptions_is_deactivated() { AbstractAssert.throwUnsupportedExceptionOnEquals = false; assertions.equals("anotherString"); }
/** * Delegate call to public static <ACTUAL,ELEMENT,ELEMENT_ASSERT> org.assertj.core.api.ClassBasedNavigableIterableAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> org.assertj.core.api.Assertions.assertThat(ACTUAL,java.lang.Class<ELEMENT_ASSERT>) * {@link org.assertj.core.api.Assertions#assertThat(java.lang.Iterable,java.lang.Class)} */ default <ACTUAL extends Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>> ClassBasedNavigableIterableAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> assertThat(ACTUAL arg0, Class<ELEMENT_ASSERT> arg1) { return Assertions.assertThat(arg0, arg1); }
/** * Delegate call to public static <ACTUAL,ELEMENT,ELEMENT_ASSERT> org.assertj.core.api.FactoryBasedNavigableIterableAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> org.assertj.core.api.Assertions.assertThat(java.lang.Iterable<? extends ELEMENT>,org.assertj.core.api.AssertFactory<ELEMENT, ELEMENT_ASSERT>) * {@link org.assertj.core.api.Assertions#assertThat(java.lang.Iterable,org.assertj.core.api.AssertFactory)} */ default <ACTUAL extends Iterable<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>> FactoryBasedNavigableIterableAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> assertThat(Iterable<? extends ELEMENT> arg0, AssertFactory<ELEMENT, ELEMENT_ASSERT> arg1) { return Assertions.assertThat(arg0, arg1); }
/** * Delegate call to public static <ACTUAL,ELEMENT,ELEMENT_ASSERT> org.assertj.core.api.FactoryBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> org.assertj.core.api.Assertions.assertThat(java.util.List<? extends ELEMENT>,org.assertj.core.api.AssertFactory<ELEMENT, ELEMENT_ASSERT>) * {@link org.assertj.core.api.Assertions#assertThat(java.util.List,org.assertj.core.api.AssertFactory)} */ default <ACTUAL extends List<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>> FactoryBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> assertThat(List<? extends ELEMENT> arg0, AssertFactory<ELEMENT, ELEMENT_ASSERT> arg1) { return Assertions.assertThat(arg0, arg1); }
/** * Delegate call to public static <ELEMENT,ACTUAL,ELEMENT_ASSERT> org.assertj.core.api.ClassBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> org.assertj.core.api.Assertions.assertThat(java.util.List<? extends ELEMENT>,java.lang.Class<ELEMENT_ASSERT>) * {@link org.assertj.core.api.Assertions#assertThat(java.util.List,java.lang.Class)} */ default <ELEMENT,ACTUAL extends List<? extends ELEMENT>,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>> ClassBasedNavigableListAssert<?, ACTUAL, ELEMENT, ELEMENT_ASSERT> assertThat(List<? extends ELEMENT> arg0, Class<ELEMENT_ASSERT> arg1) { return Assertions.assertThat(arg0, arg1); }