@Bean(initMethod = "init") public Clients clients() { List<String> tenantCodes = Lists.newArrayList("qa", "demo"); return new Clients( callbackUrl, createAllPossibleClientsFromProperties( PropertyUtils.getPropertiesWithPrefix(properties, AUTH_CLIENT_PROPERTY_PREFIX), tenantCodes)); }
@Test public void testInSameEntityGroup() { Entity ancestor = new Entity("foo"); ds.put(ancestor); Entity e1 = new Entity("bar", ancestor.getKey()); ds.put(e1); Entity e2 = new Entity("baz", "Bob", e1.getKey()); Entity e3 = new Entity("foo"); ds.put(Lists.newArrayList(e2, e3)); assertTrue(EntityUtil.inSameEntityGroup(ancestor, e1, e2)); assertFalse(EntityUtil.inSameEntityGroup(ancestor, e1, e2, e3)); }
public void testArgumentBuilding() throws Exception { doArgumentBuildingTest(new Integer[] {}); doArgumentBuildingTest(new String[] {"hello"}, "hello"); doArgumentBuildingTest(new Integer[] {5, 7}, 5, 7); doArgumentBuildingTest(new Object[] {"hello", 5, null}, "hello", 5, null); doArgumentBuildingTest(new Object[] {6, 8}, new PhantomMarker(5), 6, new PhantomMarker(7), 8); doArgumentBuildingTest(new Object[] {Lists.newArrayList(1, 2, 3)}, new ListMarker(1, 2, 3)); doArgumentBuildingTest(new Object[] {Lists.newArrayList(1, 2, 3)}, Lists.newArrayList(1, 2, 3)); doArgumentBuildingTest( new Object[] {Lists.newArrayList(1, 2, 3), Lists.newArrayList("red", "blue")}, Lists.newArrayList(1, 2, 3), Lists.newArrayList("red", "blue")); doArgumentBuildingTest( new Object[] { "hello", 5, Lists.newArrayList(1, 2, 3), "apple", Lists.newArrayList(2, 3, 4), Lists.newArrayList(4, 5, 6), Lists.newArrayList(7), Lists.newArrayList("red", "blue") }, "hello", 5, new PhantomMarker("goodbye"), new ListMarker(1, 2, 3), "apple", new ListMarker(2, 3, 4), new ListMarker(4, 5, 6), new PhantomMarker("banana"), new ListMarker(7), Lists.newArrayList("red", "blue")); }