@Test public void testExpandBasicWithMapResolver() { Map<String,String> propsMap = new HashMap<>(); propsMap.put(testPropName, testPropValue); Resolver resolver = new VariableExpansion.MapResolver(propsMap); try { VariableExpansion.expand("${" + testNamePrefix + "-not-set" + "}", resolver); fail("Should have failed to expand, property not set"); } catch (IllegalArgumentException iae) { } String expanded = VariableExpansion.expand(testVariableForExpansion, resolver); assertEquals("Expanded variable not as expected", testPropValue, expanded); }
public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } private  VariableExpansion(); }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } private  VariableExpansion(); static final String expand(String input, Resolver resolver); }
VariableExpansion { public static final String expand(String input, Resolver resolver) throws UnresolvedVariableException, IllegalArgumentException, NullPointerException { if(resolver == null) { throw new NullPointerException("Resolver must be supplied"); } if (input == null) { return null; } return expand0(input, resolver, new Stack<String>()); } private  VariableExpansion(); static final String expand(String input, Resolver resolver); static final Resolver ENV_VAR_RESOLVER; static final Resolver SYS_PROP_RESOLVER; }