@Test public void testGetSubjectVersions() { try { ResponseEntity entity = mock(ResponseEntity.class); when(service.restTemplate.getForEntity( "${kafka.schema.registry.url}/subjects/sub/versions", Integer[].class)).thenReturn(entity); when(entity.getBody()).thenReturn(new Integer[]{1, 2}); service.getSubjectVersions("sub"); assertTrue(true); } catch (Throwable t) { fail("Cannot get all tables from all dbs"); } }
@Override public Iterable<Integer> getSubjectVersions(String subject) { String path = "/subjects/" + subject + "/versions"; String regUrl = registryUrl(path); ResponseEntity<Integer[]> res = restTemplate.getForEntity(regUrl, Integer[].class); Iterable<Integer> result = Arrays.asList(res.getBody()); return result; }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<Integer> getSubjectVersions(String subject) { String path = "/subjects/" + subject + "/versions"; String regUrl = registryUrl(path); ResponseEntity<Integer[]> res = restTemplate.getForEntity(regUrl, Integer[].class); Iterable<Integer> result = Arrays.asList(res.getBody()); return result; } }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<Integer> getSubjectVersions(String subject) { String path = "/subjects/" + subject + "/versions"; String regUrl = registryUrl(path); ResponseEntity<Integer[]> res = restTemplate.getForEntity(regUrl, Integer[].class); Iterable<Integer> result = Arrays.asList(res.getBody()); return result; }  }
KafkaSchemaServiceImpl implements KafkaSchemaService { @Override public Iterable<Integer> getSubjectVersions(String subject) { String path = "/subjects/" + subject + "/versions"; String regUrl = registryUrl(path); ResponseEntity<Integer[]> res = restTemplate.getForEntity(regUrl, Integer[].class); Iterable<Integer> 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<Integer> getSubjectVersions(String subject) { String path = "/subjects/" + subject + "/versions"; String regUrl = registryUrl(path); ResponseEntity<Integer[]> res = restTemplate.getForEntity(regUrl, Integer[].class); Iterable<Integer> 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);  }