Clean up streams in SetNumInstancesCommand

Also using Service instead of serviceId String - because it helps readability.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=228952033
This commit is contained in:
guyben 2019-01-11 15:03:15 -08:00 committed by Ben McIlwain
parent 773af1da35
commit fd8a18b72e
2 changed files with 68 additions and 73 deletions

View file

@ -60,7 +60,7 @@ public class SetNumInstancesCommandTest extends CommandTestCase<SetNumInstancesC
assertThrows(
IllegalArgumentException.class,
() -> runCommand("--services=", "--versions=version", "--num_instances=5"));
assertThat(thrown).hasMessageThat().contains("Invalid service(s): []");
assertThat(thrown).hasMessageThat().contains("Invalid service ''");
}
@Test
@ -71,7 +71,7 @@ public class SetNumInstancesCommandTest extends CommandTestCase<SetNumInstancesC
() ->
runCommand(
"--services=INVALID,DEFAULT", "--versions=version", "--num_instances=5"));
assertThat(thrown).hasMessageThat().contains("Invalid service(s): [INVALID]");
assertThat(thrown).hasMessageThat().contains("Invalid service 'INVALID'");
}
@Test