io.confluent.kafka.schemaregistry.client.rest.entities.Config Java Examples

The following examples show how to use io.confluent.kafka.schemaregistry.client.rest.entities.Config. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KafkaSchemaServiceImpl.java    From griffin with Apache License 2.0 5 votes vote down vote up
@Override
public Config getTopLevelConfig() {
    String path = "/config";
    String regUrl = registryUrl(path);
    ResponseEntity<Config> res = restTemplate.getForEntity(regUrl,
        Config.class);
    Config result = res.getBody();
    return result;
}
 
Example #2
Source File: KafkaSchemaServiceImpl.java    From griffin with Apache License 2.0 5 votes vote down vote up
@Override
public Config getSubjectLevelConfig(String subject) {
    String path = "/config/" + subject;
    String regUrl = registryUrl(path);
    ResponseEntity<Config> res = restTemplate.getForEntity(regUrl,
        Config.class);
    Config result = res.getBody();
    return result;
}
 
Example #3
Source File: KafkaSchemaServiceImplTest.java    From griffin with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetTopLevelConfig() {
    try {
        Config config = mock(Config.class);
        ResponseEntity entity = mock(ResponseEntity.class);
        when(service.restTemplate.getForEntity(
                "${kafka.schema.registry.url}/config",
                Config.class)).thenReturn(entity);
        when(entity.getBody()).thenReturn(config);
        service.getTopLevelConfig();
        assertTrue(true);
    } catch (Throwable t) {
        fail("Cannot get all tables from all dbs");
    }
}
 
Example #4
Source File: KafkaSchemaServiceImplTest.java    From griffin with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetSubjectLevelConfig() {
    try {
        Config config = mock(Config.class);
        ResponseEntity entity = mock(ResponseEntity.class);
        when(service.restTemplate.getForEntity(
                "${kafka.schema.registry.url}/config/subject",
                Config.class)).thenReturn(entity);
        when(entity.getBody()).thenReturn(config);
        service.getSubjectLevelConfig("subject");
        assertTrue(true);
    } catch (Throwable t) {
        fail("Cannot get all tables from all dbs");
    }
}
 
Example #5
Source File: SchemaRegistryMock.java    From schema-registry-transfer-smt with Apache License 2.0 4 votes vote down vote up
@Override
public ResponseDefinition transform(final Request request, final ResponseDefinition responseDefinition,
                                    final FileSource files, final Parameters parameters) {
    Config config = new Config(SchemaRegistryMock.this.getCompatibility(getSubject(request)));
    return ResponseDefinitionBuilder.jsonResponse(config);
}
 
Example #6
Source File: KafkaSchemaController.java    From griffin with Apache License 2.0 4 votes vote down vote up
@RequestMapping(value = "/config", method = RequestMethod.GET)
public Config getTopLevelConfig() {
    return kafkaSchemaService.getTopLevelConfig();
}
 
Example #7
Source File: KafkaSchemaController.java    From griffin with Apache License 2.0 4 votes vote down vote up
@RequestMapping(value = "/config/{subject}", method = RequestMethod.GET)
public Config getSubjectLevelConfig(@PathVariable("subject") String subject) {
    return kafkaSchemaService.getSubjectLevelConfig(subject);
}
 
Example #8
Source File: BCachedSchemaRegistryClient.java    From replicator with Apache License 2.0 4 votes vote down vote up
public String getCompatibility(String subject) throws IOException, RestClientException {
    Config response = this.restService.getConfig(subject);
    return response.getCompatibilityLevel();
}
 
Example #9
Source File: KafkaSchemaService.java    From griffin with Apache License 2.0 votes vote down vote up
Config getTopLevelConfig(); 
Example #10
Source File: KafkaSchemaService.java    From griffin with Apache License 2.0 votes vote down vote up
Config getSubjectLevelConfig(String subject);