GeneratePiiCommand extends AbstractCommand { @Override public void execute(CommandContext context) { entityManager.savePii(); }  @Override void execute(CommandContext context); void setHubConfig(HubConfig hubAdminConfig);  }
@Test public void generatePii() throws IOException { installEntities(); generatePiiCommand.execute(null); File protectedPathConfig = getDataHubAdminConfig().getUserSecurityDir().resolve("protected-paths/01_" + HubConfig.PII_PROTECTED_PATHS_FILE).toFile(); File secondProtectedPathConfig = getDataHubAdminConfig().getUserSecurityDir().resolve("protected-paths/02_" + HubConfig.PII_PROTECTED_PATHS_FILE).toFile(); File queryRolesetsConfig = getDataHubAdminConfig().getUserSecurityDir().resolve("query-rolesets/" + HubConfig.PII_QUERY_ROLESET_FILE).toFile(); ObjectMapper mapper = new ObjectMapper(); JsonNode protectedPaths = mapper.readTree(protectedPathConfig); assertTrue("Protected Path Config should have path expression.", protectedPaths.get("path-expression").isTextual()); protectedPaths = mapper.readTree(secondProtectedPathConfig); assertTrue("Protected Path Config should have path expression.", protectedPaths.get("path-expression").isTextual()); JsonNode rolesets = mapper.readTree(queryRolesetsConfig); assertEquals("Config should have one roleset, pii-reader.", "pii-reader", rolesets.get("role-name").get(0).asText()); }