DefaultDbUriExtractor implements DbUriExtractor { @Override public String extract(AbsoluteLocation location) { URI uri = location.location().asURI(); if (uri.getPath() == null) { throw new IllegalArgumentException("Wrong url format"); } String[] uriParts = uri.getPath().split("/"); return uri.getScheme().replaceAll("-", ":") + ": }  @Override String extract(AbsoluteLocation location);  }
@Test void validateExtract() { String dbConnUri = new DefaultDbUriExtractor().extract( BasePrivateResource.forAbsolutePrivate( URI.create("jdbc-mysql: ) ); assertThat(dbConnUri).isEqualTo("jdbc:mysql: }