@Test public void returnsFalseWhenThereAreFailedTests() { AggregatedTestResult aggregatedTestResult = aggregatedTestResult() .withPoolTestResults(asList( poolTestResult() .withPool(aDevicePool().build()) .withTestResults(asList( aTestResult() .withErrorTrace("aTrace") .build(), aTestResult().build() )) .build(), poolTestResult() .withPool(aDevicePool().build()) .withTestResults(singletonList(aTestResult().build())) .build() )) .build(); boolean isSuccessful = new OutcomeAggregator().aggregate(aggregatedTestResult); assertThat(isSuccessful, equalTo(false)); }
@SuppressWarnings("SimplifiableIfStatement") public boolean aggregate(AggregatedTestResult aggregatedTestResult) { if (!aggregatedTestResult.getFatalCrashedTests().isEmpty()) { return false; } return aggregatedTestResult.getPoolTestResults().stream() .map(PoolTestResult::getTestResults) .flatMap(Collection::stream) .allMatch(testResult -> testResult.getResultStatus() == PASS || testResult.getResultStatus() == IGNORED); }
OutcomeAggregator { @SuppressWarnings("SimplifiableIfStatement") public boolean aggregate(AggregatedTestResult aggregatedTestResult) { if (!aggregatedTestResult.getFatalCrashedTests().isEmpty()) { return false; } return aggregatedTestResult.getPoolTestResults().stream() .map(PoolTestResult::getTestResults) .flatMap(Collection::stream) .allMatch(testResult -> testResult.getResultStatus() == PASS || testResult.getResultStatus() == IGNORED); } }
OutcomeAggregator { @SuppressWarnings("SimplifiableIfStatement") public boolean aggregate(AggregatedTestResult aggregatedTestResult) { if (!aggregatedTestResult.getFatalCrashedTests().isEmpty()) { return false; } return aggregatedTestResult.getPoolTestResults().stream() .map(PoolTestResult::getTestResults) .flatMap(Collection::stream) .allMatch(testResult -> testResult.getResultStatus() == PASS || testResult.getResultStatus() == IGNORED); }  }
OutcomeAggregator { @SuppressWarnings("SimplifiableIfStatement") public boolean aggregate(AggregatedTestResult aggregatedTestResult) { if (!aggregatedTestResult.getFatalCrashedTests().isEmpty()) { return false; } return aggregatedTestResult.getPoolTestResults().stream() .map(PoolTestResult::getTestResults) .flatMap(Collection::stream) .allMatch(testResult -> testResult.getResultStatus() == PASS || testResult.getResultStatus() == IGNORED); }  @SuppressWarnings("SimplifiableIfStatement") boolean aggregate(AggregatedTestResult aggregatedTestResult); }
OutcomeAggregator { @SuppressWarnings("SimplifiableIfStatement") public boolean aggregate(AggregatedTestResult aggregatedTestResult) { if (!aggregatedTestResult.getFatalCrashedTests().isEmpty()) { return false; } return aggregatedTestResult.getPoolTestResults().stream() .map(PoolTestResult::getTestResults) .flatMap(Collection::stream) .allMatch(testResult -> testResult.getResultStatus() == PASS || testResult.getResultStatus() == IGNORED); }  @SuppressWarnings("SimplifiableIfStatement") boolean aggregate(AggregatedTestResult aggregatedTestResult);  }