Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/test/java/com/google/acai/DependenciesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ private static class ServiceB implements TestingService {}

@Test
public void arbitraryOrdering() {
Set<TestingService> testingServices =
ImmutableSet.of(new ServiceA(), new ServiceB(), new ServiceA());
Set<TestingService> testingServices = ImmutableSet.of(new ServiceA(), new ServiceB());

assertThat(Dependencies.inOrder(testingServices)).containsExactlyElementsIn(testingServices);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static org.junit.Assert.assertThrows;

import com.google.guiceberry.GuiceBerryEnvMain;
import com.google.guiceberry.GuiceBerryModule;
Expand Down Expand Up @@ -128,24 +129,23 @@ public void evaluate() {
}

@Test
public void testWrapperExceptionPropagated() throws Throwable {
public void testWrapperExceptionPropagated() {
FakeTestClass test = new FakeTestClass();

try {
new Acai(ThrowingWrapperModule.class)
.apply(
new Statement() {
@Override
public void evaluate() {
assertWithMessage("Test should not run when TestWrapper throws").fail();
}
},
frameworkMethod,
test)
.evaluate();
assertWithMessage("Exception from TestWrapper should be propagated").fail();
} catch (TestException expected) {
}
assertThrows(
TestException.class,
() ->
new Acai(ThrowingWrapperModule.class)
.apply(
new Statement() {
@Override
public void evaluate() {
assertWithMessage("Test should not run when TestWrapper throws").fail();
}
},
frameworkMethod,
test)
.evaluate());
}

private static class FakeTestClass {
Expand Down
Loading