BaseDynoDAO { String nsKey(String... nsValues) { String rootNamespace = config.getProperty("workflow.namespace.prefix", null); StringBuilder namespacedKey = new StringBuilder(); if (StringUtils.isNotBlank(rootNamespace)) { namespacedKey.append(rootNamespace).append(NAMESPACE_SEP); } String stack = config.getStack(); if (StringUtils.isNotBlank(stack)) { namespacedKey.append(stack).append(NAMESPACE_SEP); } if (StringUtils.isNotBlank(domain)) { namespacedKey.append(domain).append(NAMESPACE_SEP); } for (int i = 0; i < nsValues.length; i++) { namespacedKey.append(nsValues[i]).append(NAMESPACE_SEP); } return StringUtils.removeEnd(namespacedKey.toString(), NAMESPACE_SEP); } protected  BaseDynoDAO(DynoProxy dynoClient, ObjectMapper objectMapper, Configuration config); DynoProxy getDyno();  }
@Test public void testNsKey() { assertEquals("", baseDynoDAO.nsKey()); String[] keys = {"key1", "key2"}; assertEquals("key1.key2", baseDynoDAO.nsKey(keys)); Mockito.when(config.getProperty("workflow.namespace.prefix", null)).thenReturn("test"); assertEquals("test", baseDynoDAO.nsKey()); assertEquals("test.key1.key2", baseDynoDAO.nsKey(keys)); Mockito.when(config.getStack()).thenReturn("stack"); assertEquals("test.stack.key1.key2", baseDynoDAO.nsKey(keys)); }