@Test public void testGetSubjects() { try { ResponseEntity entity = mock(ResponseEntity.class); when(service.restTemplate.getForEntity( "${kafka.schema.registry.url}/subjects", String[].class)).thenReturn(entity); when(entity.getBody()).thenReturn(new String[]{"aaa", "bbb"}); service.getSubjects(); assertTrue(true); } catch (Throwable t) { fail("Cannot get all tables from all dbs"); } }
@Override public Iterable<String> getSubjects() { String path = "/subjects"; String regUrl = registryUrl(path); ResponseEntity<String[]> res = restTemplate.getForEntity(regUrl, String[].class); Iterable<String> result = Arrays.asList(res.getBody()); return result; }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<String> getSubjects() { String path = "/subjects"; String regUrl = registryUrl(path); ResponseEntity<String[]> res = restTemplate.getForEntity(regUrl, String[].class); Iterable<String> result = Arrays.asList(res.getBody()); return result; } }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<String> getSubjects() { String path = "/subjects"; String regUrl = registryUrl(path); ResponseEntity<String[]> res = restTemplate.getForEntity(regUrl, String[].class); Iterable<String> result = Arrays.asList(res.getBody()); return result; }  }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<String> getSubjects() { String path = "/subjects"; String regUrl = registryUrl(path); ResponseEntity<String[]> res = restTemplate.getForEntity(regUrl, String[].class); Iterable<String> result = Arrays.asList(res.getBody()); return result; }  @Override SchemaString getSchemaString(Integer id); @Override Iterable<String> getSubjects(); @Override Iterable<Integer> getSubjectVersions(String subject); @Override Schema getSubjectSchema(String subject, String version); @Override Config getTopLevelConfig(); @Override Config getSubjectLevelConfig(String subject); }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<String> getSubjects() { String path = "/subjects"; String regUrl = registryUrl(path); ResponseEntity<String[]> res = restTemplate.getForEntity(regUrl, String[].class); Iterable<String> result = Arrays.asList(res.getBody()); return result; }  @Override SchemaString getSchemaString(Integer id); @Override Iterable<String> getSubjects(); @Override Iterable<Integer> getSubjectVersions(String subject); @Override Schema getSubjectSchema(String subject, String version); @Override Config getTopLevelConfig(); @Override Config getSubjectLevelConfig(String subject);  }