/** * Returns a copy of list of soft assertions collected errors. * @return a copy of list of soft assertions collected errors. */ public List<Throwable> errorsCollected() { return decorateErrorsCollected(proxies.errorsCollected()); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override SELF withAssertionState(AbstractAssert assertInstance) { if (assertInstance instanceof AbstractObjectAssert) { AbstractObjectAssert objectAssert = (AbstractObjectAssert) assertInstance; return (SELF) super.withAssertionState(assertInstance).withTypeComparator(objectAssert.comparatorByType) .withComparatorByPropertyOrField(objectAssert.comparatorByPropertyOrField); } return super.withAssertionState(assertInstance); }
@Override public ListAssert<ELEMENT> isEqualTo(Object expected) { if (actual instanceof ListFromStream && asListFromStream().stream == expected) { return myself; } return super.isEqualTo(expected); }
@Test public void findsExpectedRef() { List<TrackedReference> trackedReferences = findTrackedReferences(ASYNC_TASK_M); assertThat(trackedReferences).hasSize(1); TrackedReference firstRef = trackedReferences.get(0); assertThat(firstRef.key).isEqualTo(ASYNC_TASK_M.referenceKey); assertThat(firstRef.className).isEqualTo("com.example.leakcanary.MainActivity"); }
@Test public void testUserConstructorHappyCase() { final int userId = user.getUserId(); assertThat(userId).isEqualTo(FAKE_USER_ID); } }
private static void assertMergeHiveColumnStatistics(HiveColumnStatistics first, HiveColumnStatistics second, HiveColumnStatistics expected) { assertThat(merge(first, second)).isEqualTo(expected); assertThat(merge(second, first)).isEqualTo(expected); } }
public void waitForPrompt() { assertThat(nextOutputToken()).matches(PRESTO_PROMPT_PATTERN); } }
private static void assertThatStatisticsAreNotPresent(BasicStatistics statistics) { assertThat(statistics.getNumRows()).isNotPresent(); assertThat(statistics.getNumFiles()).isNotPresent(); assertThat(statistics.getRawDataSize()).isNotPresent(); assertThat(statistics.getTotalSize()).isNotPresent(); }
private static void assertThatStatisticsArePresent(BasicStatistics statistics) { assertThat(statistics.getNumRows()).isPresent(); assertThat(statistics.getNumFiles()).isPresent(); assertThat(statistics.getRawDataSize()).isPresent(); assertThat(statistics.getTotalSize()).isPresent(); }
private void assertUnsupportedColumnTypeException(ThrowableAssert.ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageMatching("Unsupported column type .* for column .*"); }
@Test public void testBuildUseCaseObservableReturnCorrectResult() { useCase.execute(testObserver, Params.EMPTY); assertThat(testObserver.valuesCount).isZero(); }
private void assertMappingDoesNotMatchDataFormatException(ThrowableAssert.ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageContaining("Bytes mapping for column 'some_column' does not match dataFormat"); }
private static void assertFails(String fileName, String expectedPattern) { assertThatThrownBy(() -> parse(fileName)).hasMessageMatching(expectedPattern); } }
@Override public ProxyableListAssert<ELEMENT> isEqualTo(Object expected) { if (actual instanceof ProxyableListAssert.ListFromStream && asListFromStream().stream == expected) { return myself; } return super.isEqualTo(expected); }
private void assertWrongDataFormatException(ThrowableAssert.ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageMatching("Wrong dataFormat .* specified for column .*"); }
private void assertInvalidConversion(Binder binder, String message) { assertThatThrownBy(() -> assertParameter(null, Types.NULL, binder)) .isInstanceOf(SQLException.class) .hasMessageContaining(message); }
private void assertRuntimeDecodingFailure(ThrowableAssert.ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageMatching("could not parse value .* as .* for column .*"); } }
private void assertUnsupportedColumnTypeException(ThrowableAssert.ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageMatching("Unsupported column type .* for column .*"); }
private void assertUnsupportedColumnTypeException(ThrowableAssert.ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageMatching("Unsupported column type .* for column .*"); }
private void assertUnsupportedColumnTypeException(ThrowingCallable callable) { assertThatThrownBy(callable) .isInstanceOf(PrestoException.class) .hasMessageMatching("unsupported column type .* for column .*"); }