Use method references instead of lambdas when possible

The assertThrows/expectThrows refactoring script does not use method
references, apparently.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179089048
This commit is contained in:
mcilwain 2017-12-14 13:40:15 -08:00 committed by Ben McIlwain
parent e619ea1bff
commit fbe11ff33c
35 changed files with 483 additions and 483 deletions

View file

@ -264,7 +264,7 @@ public class DomainApplicationInfoFlowTest
@Test
public void testFailure_neverExisted() throws Exception {
ResourceDoesNotExistException thrown =
expectThrows(ResourceDoesNotExistException.class, () -> runFlow());
expectThrows(ResourceDoesNotExistException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand()));
}
@ -277,7 +277,7 @@ public class DomainApplicationInfoFlowTest
.setRegistrant(Key.create(persistActiveContact("jd1234")))
.build());
ResourceDoesNotExistException thrown =
expectThrows(ResourceDoesNotExistException.class, () -> runFlow());
expectThrows(ResourceDoesNotExistException.class, this::runFlow);
assertThat(thrown).hasMessageThat().contains(String.format("(%s)", getUniqueIdFromCommand()));
}
@ -287,7 +287,7 @@ public class DomainApplicationInfoFlowTest
AppEngineRule.makeRegistrar1().asBuilder().setClientId("ClientZ").build());
sessionMetadata.setClientId("ClientZ");
persistTestEntities(HostsState.NO_HOSTS_EXIST, MarksState.NO_MARKS_EXIST);
assertThrows(ResourceNotOwnedException.class, () -> runFlow());
assertThrows(ResourceNotOwnedException.class, this::runFlow);
}
@Test
@ -298,14 +298,14 @@ public class DomainApplicationInfoFlowTest
.setRegistrant(Key.create(persistActiveContact("jd1234")))
.setPhase(LaunchPhase.SUNRUSH)
.build());
assertThrows(ApplicationDomainNameMismatchException.class, () -> runFlow());
assertThrows(ApplicationDomainNameMismatchException.class, this::runFlow);
}
@Test
public void testFailure_noApplicationId() throws Exception {
setEppInput("domain_info_sunrise_no_application_id.xml");
persistTestEntities(HostsState.NO_HOSTS_EXIST, MarksState.NO_MARKS_EXIST);
assertThrows(MissingApplicationIdException.class, () -> runFlow());
assertThrows(MissingApplicationIdException.class, this::runFlow);
}
@Test
@ -313,7 +313,7 @@ public class DomainApplicationInfoFlowTest
persistTestEntities(HostsState.NO_HOSTS_EXIST, MarksState.NO_MARKS_EXIST);
application = persistResource(
application.asBuilder().setPhase(LaunchPhase.SUNRISE).build());
assertThrows(ApplicationLaunchPhaseMismatchException.class, () -> runFlow());
assertThrows(ApplicationLaunchPhaseMismatchException.class, this::runFlow);
}
/** Test that we load contacts and hosts as a batch rather than individually. */