Search in sources :

Example 1 with Macros

use of co.cask.cdap.api.macro.Macros in project cdap by caskdata.

the class ArtifactRepositoryTest method testPluginProperties.

@Test
public void testPluginProperties() throws Exception {
    PluginProperties pluginProperties = PluginProperties.builder().add("class.name", TEST_EMPTY_CLASS).add("timeout", "10").add("name", "${macro}").build();
    Assert.assertTrue(pluginProperties.getMacros().getLookups().isEmpty());
    Set<String> lookups = new HashSet<>();
    lookups.add("macro");
    PluginProperties updatedPluginProperties = pluginProperties.setMacros(new Macros(lookups, new HashSet<MacroFunction>()));
    Assert.assertTrue(pluginProperties.getMacros().getLookups().isEmpty());
    Assert.assertEquals(lookups, updatedPluginProperties.getMacros().getLookups());
    Assert.assertTrue(updatedPluginProperties.getMacros().getMacroFunctions().isEmpty());
}
Also used : PluginProperties(co.cask.cdap.api.plugin.PluginProperties) Macros(co.cask.cdap.api.macro.Macros) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

Macros (co.cask.cdap.api.macro.Macros)1 PluginProperties (co.cask.cdap.api.plugin.PluginProperties)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1