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

@ -274,20 +274,20 @@ public class DomainCheckFlowTest
@Test
public void testFailure_tooManyIds() throws Exception {
setEppInput("domain_check_51.xml");
assertThrows(TooManyResourceChecksException.class, () -> runFlow());
assertThrows(TooManyResourceChecksException.class, this::runFlow);
}
@Test
public void testFailure_wrongTld() throws Exception {
setEppInput("domain_check.xml");
assertThrows(TldDoesNotExistException.class, () -> runFlow());
assertThrows(TldDoesNotExistException.class, this::runFlow);
}
@Test
public void testFailure_notAuthorizedForTld() throws Exception {
persistResource(
loadRegistrar("TheRegistrar").asBuilder().setAllowedTlds(ImmutableSet.of()).build());
assertThrows(NotAuthorizedForTldException.class, () -> runFlow());
assertThrows(NotAuthorizedForTldException.class, this::runFlow);
}
@Test
@ -386,7 +386,7 @@ public class DomainCheckFlowTest
@Test
public void testFailure_predelegation() throws Exception {
createTld("tld", TldState.PREDELEGATION);
assertThrows(BadCommandForRegistryPhaseException.class, () -> runFlow());
assertThrows(BadCommandForRegistryPhaseException.class, this::runFlow);
}
@Test
@ -673,152 +673,152 @@ public class DomainCheckFlowTest
@Test
public void testFeeExtension_wrongCurrency_v06() throws Exception {
setEppInput("domain_check_fee_euro_v06.xml");
assertThrows(CurrencyUnitMismatchException.class, () -> runFlow());
assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
}
@Test
public void testFeeExtension_wrongCurrency_v11() throws Exception {
setEppInput("domain_check_fee_euro_v11.xml");
assertThrows(CurrencyUnitMismatchException.class, () -> runFlow());
assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
}
@Test
public void testFeeExtension_wrongCurrency_v12() throws Exception {
setEppInput("domain_check_fee_euro_v12.xml");
assertThrows(CurrencyUnitMismatchException.class, () -> runFlow());
assertThrows(CurrencyUnitMismatchException.class, this::runFlow);
}
@Test
public void testFeeExtension_periodNotInYears_v06() throws Exception {
setEppInput("domain_check_fee_bad_period_v06.xml");
assertThrows(BadPeriodUnitException.class, () -> runFlow());
assertThrows(BadPeriodUnitException.class, this::runFlow);
}
@Test
public void testFeeExtension_periodNotInYears_v11() throws Exception {
setEppInput("domain_check_fee_bad_period_v11.xml");
assertThrows(BadPeriodUnitException.class, () -> runFlow());
assertThrows(BadPeriodUnitException.class, this::runFlow);
}
@Test
public void testFeeExtension_periodNotInYears_v12() throws Exception {
setEppInput("domain_check_fee_bad_period_v12.xml");
assertThrows(BadPeriodUnitException.class, () -> runFlow());
assertThrows(BadPeriodUnitException.class, this::runFlow);
}
@Test
public void testFeeExtension_commandWithPhase_v06() throws Exception {
setEppInput("domain_check_fee_command_phase_v06.xml");
assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow());
assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
}
@Test
public void testFeeExtension_commandWithPhase_v11() throws Exception {
setEppInput("domain_check_fee_command_phase_v11.xml");
assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow());
assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
}
@Test
public void testFeeExtension_commandWithPhase_v12() throws Exception {
setEppInput("domain_check_fee_command_phase_v12.xml");
assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow());
assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
}
@Test
public void testFeeExtension_commandSubphase_v06() throws Exception {
setEppInput("domain_check_fee_command_subphase_v06.xml");
assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow());
assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
}
@Test
public void testFeeExtension_commandSubphase_v11() throws Exception {
setEppInput("domain_check_fee_command_subphase_v11.xml");
assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow());
assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
}
@Test
public void testFeeExtension_commandSubphase_v12() throws Exception {
setEppInput("domain_check_fee_command_subphase_v12.xml");
assertThrows(FeeChecksDontSupportPhasesException.class, () -> runFlow());
assertThrows(FeeChecksDontSupportPhasesException.class, this::runFlow);
}
// This test is only relevant for v06, since domain names are not specified in v11 or v12.
@Test
public void testFeeExtension_feeCheckNotInAvailabilityCheck() throws Exception {
setEppInput("domain_check_fee_not_in_avail.xml");
assertThrows(OnlyCheckedNamesCanBeFeeCheckedException.class, () -> runFlow());
assertThrows(OnlyCheckedNamesCanBeFeeCheckedException.class, this::runFlow);
}
@Test
public void testFeeExtension_multiyearRestore_v06() throws Exception {
setEppInput("domain_check_fee_multiyear_restore_v06.xml");
assertThrows(RestoresAreAlwaysForOneYearException.class, () -> runFlow());
assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
}
@Test
public void testFeeExtension_multiyearRestore_v11() throws Exception {
setEppInput("domain_check_fee_multiyear_restore_v11.xml");
assertThrows(RestoresAreAlwaysForOneYearException.class, () -> runFlow());
assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
}
@Test
public void testFeeExtension_multiyearRestore_v12() throws Exception {
setEppInput("domain_check_fee_multiyear_restore_v12.xml");
assertThrows(RestoresAreAlwaysForOneYearException.class, () -> runFlow());
assertThrows(RestoresAreAlwaysForOneYearException.class, this::runFlow);
}
@Test
public void testFeeExtension_multiyearTransfer_v06() throws Exception {
setEppInput("domain_check_fee_multiyear_transfer_v06.xml");
assertThrows(TransfersAreAlwaysForOneYearException.class, () -> runFlow());
assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);
}
@Test
public void testFeeExtension_multiyearTransfer_v11() throws Exception {
setEppInput("domain_check_fee_multiyear_transfer_v11.xml");
assertThrows(TransfersAreAlwaysForOneYearException.class, () -> runFlow());
assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);
}
@Test
public void testFeeExtension_multiyearTransfer_v12() throws Exception {
setEppInput("domain_check_fee_multiyear_transfer_v12.xml");
assertThrows(TransfersAreAlwaysForOneYearException.class, () -> runFlow());
assertThrows(TransfersAreAlwaysForOneYearException.class, this::runFlow);
}
@Test
public void testFeeExtension_unknownCommand_v06() throws Exception {
setEppInput("domain_check_fee_unknown_command_v06.xml");
assertThrows(UnknownFeeCommandException.class, () -> runFlow());
assertThrows(UnknownFeeCommandException.class, this::runFlow);
}
@Test
public void testFeeExtension_unknownCommand_v11() throws Exception {
setEppInput("domain_check_fee_unknown_command_v11.xml");
assertThrows(UnknownFeeCommandException.class, () -> runFlow());
assertThrows(UnknownFeeCommandException.class, this::runFlow);
}
@Test
public void testFeeExtension_unknownCommand_v12() throws Exception {
setEppInput("domain_check_fee_unknown_command_v12.xml");
assertThrows(UnknownFeeCommandException.class, () -> runFlow());
assertThrows(UnknownFeeCommandException.class, this::runFlow);
}
@Test
public void testFeeExtension_invalidCommand_v06() throws Exception {
setEppInput("domain_check_fee_invalid_command_v06.xml");
assertThrows(UnknownFeeCommandException.class, () -> runFlow());
assertThrows(UnknownFeeCommandException.class, this::runFlow);
}
@Test
public void testFeeExtension_invalidCommand_v11() throws Exception {
setEppInput("domain_check_fee_invalid_command_v11.xml");
assertThrows(UnknownFeeCommandException.class, () -> runFlow());
assertThrows(UnknownFeeCommandException.class, this::runFlow);
}
@Test
public void testFeeExtension_invalidCommand_v12() throws Exception {
setEppInput("domain_check_fee_invalid_command_v12.xml");
assertThrows(UnknownFeeCommandException.class, () -> runFlow());
assertThrows(UnknownFeeCommandException.class, this::runFlow);
}
private void runEapFeeCheckTest(String inputFile, String outputFile) throws Exception {