@Test public void testBuildTargetWithoutFlavor() { BuildTarget target = BuildTarget.builder(ROOT, "//foo/bar", "baz").build(); assertEquals(target.getShortNameAndFlavorPostfix(), "baz"); assertEquals(ImmutableSortedSet.<Flavor>of(), target.getFlavors()); assertFalse(target.isFlavored()); }
@Test public void testBuildTargetWithFlavor() { BuildTarget target = BuildTarget.builder(ROOT, "//foo/bar", "baz").addFlavors(ImmutableFlavor.of("dex")).build(); assertEquals("baz#dex", target.getShortNameAndFlavorPostfix()); assertEquals(ImmutableSortedSet.of(ImmutableFlavor.of("dex")), target.getFlavors()); assertTrue(target.isFlavored()); }