RegistryCenterNode { public Optional<GovernanceSchema> getGovernanceSchema(final String dataSourceNodeFullPath) { Pattern pattern = Pattern.compile(getDataNodesPath() + "/" + "(\\w+)/(\\w+)$", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(dataSourceNodeFullPath); return matcher.find() ? Optional.of(new GovernanceSchema(matcher.group(1), matcher.group(2))) : Optional.empty(); }  String getProxyNodePath(final String instanceId); String getDataNodesPath(); String getSchemaPath(final String schemaName); String getDataSourcePath(final String schemaName, final String dataSourceName); Optional<GovernanceSchema> getGovernanceSchema(final String dataSourceNodeFullPath); Collection<String> getAllSchemaPaths(final Collection<String> schemaNames);  }
@Test public void assertGetGovernanceSchema() { assertThat(registryCenterNode.getGovernanceSchema("/states/datanodes/primary_replica_db/replica_ds_0").get().getSchemaName(), is("primary_replica_db")); }