@Override
  public Schema getTargetSchema() {
    String registryUrl = getStringWithAltKeys(config, HoodieSchemaProviderConfig.SRC_SCHEMA_REGISTRY_URL);
    String targetRegistryUrl =
        getStringWithAltKeys(config, HoodieSchemaProviderConfig.TARGET_SCHEMA_REGISTRY_URL, registryUrl);
    try {
      return parseSchemaFromRegistry(targetRegistryUrl);
    } catch (Exception e) {
      throw new HoodieSchemaFetchException(String.format(
          "Error reading target schema from registry. Please check %s is configured correctly. If that is not configured then check %s. Truncated URL: %s",
          Config.SRC_SCHEMA_REGISTRY_URL_PROP,
          Config.TARGET_SCHEMA_REGISTRY_URL_PROP,
          StringUtils.truncate(targetRegistryUrl, 10, 10)), e);
    }
  }
@Test
  public void testGetTargetSchemaShouldRequestSchemaWithoutCreds() throws Exception {
    TypedProperties props = getProps();
    props.put("hoodie.deltastreamer.schemaprovider.registry.url", "http://localhost/subjects/test/versions/latest");
    SchemaRegistryProvider underTest = getUnderTest(props, -1, true);
    Schema actual = underTest.getTargetSchema();
    assertNotNull(actual);
    assertEquals(getExpectedConvertedSchema(), actual);
    verify(mockRestService, never()).setHttpHeaders(any());
  }