use of com.android.tools.build.bundletool.flags.Flag.RequiredFlagNotSetException in project bundletool by google.
the class TestUtils method expectMissingRequiredFlagException.
/**
* Tests that missing mandatory command line argument is detected.
*/
public static void expectMissingRequiredFlagException(String flag, Executable runnable) {
RequiredFlagNotSetException exception = assertThrows(RequiredFlagNotSetException.class, runnable);
assertThat(exception).hasMessageThat().contains(String.format("Missing the required --%s flag", flag));
}
use of com.android.tools.build.bundletool.flags.Flag.RequiredFlagNotSetException in project bundletool by google.
the class FlagParserTest method requiredFlagNotPresent_throws.
@Test
public void requiredFlagNotPresent_throws() throws Exception {
ParsedFlags fp = new FlagParser().parse("command", "--flag1=value1");
RequiredFlagNotSetException e = assertThrows(RequiredFlagNotSetException.class, () -> Flag.string("flag2").getRequiredValue(fp));
assertThat(e).hasMessageThat().contains("Missing the required --flag2 flag");
}
Aggregations