Fix id type on SchemaRegistrationResponse

Fixes #739

Use primitive type in `SchemaRegistryClient`
This commit is contained in:
Marius Bogoevici
2016-12-19 00:44:23 -05:00
committed by Ilayaperumal Gopinathan
parent 4d74212932
commit f6073ade89
5 changed files with 7 additions and 7 deletions

View File

@@ -21,15 +21,15 @@ package org.springframework.cloud.stream.schema;
*/
public class SchemaRegistrationResponse {
private long id;
private int id;
private SchemaReference schemaReference;
public long getId() {
public int getId() {
return this.id;
}
public void setId(long id) {
public void setId(int id) {
this.id = id;
}

View File

@@ -94,7 +94,7 @@ public class ConfluentSchemaRegistryClient implements SchemaRegistryClient {
}
@Override
public String fetch(Integer id) {
public String fetch(int id) {
String path = String.format("/schemas/ids/%d", id);
HttpHeaders headers = new HttpHeaders();
headers.put("Accept",

View File

@@ -76,7 +76,7 @@ public class DefaultSchemaRegistryClient implements SchemaRegistryClient {
}
@Override
public String fetch(Integer id) {
public String fetch(int id) {
ResponseEntity<Map> responseEntity = this.template.getForEntity(
this.endpoint + "/schemas/" + id, Map.class);
if (!responseEntity.getStatusCode().is2xxSuccessful()) {

View File

@@ -45,6 +45,6 @@ public interface SchemaRegistryClient {
* @param id the id of the target schema.
* @return
*/
String fetch(Integer id);
String fetch(int id);
}

View File

@@ -81,7 +81,7 @@ public class StubSchemaRegistryClient implements SchemaRegistryClient {
}
@Override
public String fetch(Integer id) {
public String fetch(int id) {
return this.schemasById.get(id);
}