Search in sources :

Example 1 with UnknownFlagsException

use of com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException in project bundletool by google.

the class FlagParserTest method unknownFlag_throws.

@Test
public void unknownFlag_throws() throws Exception {
    ParsedFlags fp = new FlagParser().parse("command", "--flagUnknown=value");
    UnknownFlagsException e = assertThrows(UnknownFlagsException.class, () -> fp.checkNoUnknownFlags());
    assertThat(e).hasMessageThat().contains("Unrecognized flags: --flagUnknown");
}
Also used : UnknownFlagsException(com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException) Test(org.junit.Test)

Example 2 with UnknownFlagsException

use of com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException in project bundletool by google.

the class BuildSdkApksCommandTest method unknownFlag_throws.

@Test
public void unknownFlag_throws() {
    UnknownFlagsException exception = assertThrows(UnknownFlagsException.class, () -> BuildSdkApksCommand.fromFlags(getDefaultFlagsWithAdditionalFlags("--unknownFlag=notSure")));
    assertThat(exception).hasMessageThat().contains(String.format("Unrecognized flags: --%s", "unknownFlag"));
}
Also used : UnknownFlagsException(com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException) Test(org.junit.Test)

Aggregations

UnknownFlagsException (com.android.tools.build.bundletool.flags.ParsedFlags.UnknownFlagsException)2 Test (org.junit.Test)2