Fix id type on SchemaRegistrationResponse
Fixes #739 Use primitive type in `SchemaRegistryClient`
This commit is contained in:
committed by
Ilayaperumal Gopinathan
parent
4d74212932
commit
f6073ade89
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -45,6 +45,6 @@ public interface SchemaRegistryClient {
|
||||
* @param id the id of the target schema.
|
||||
* @return
|
||||
*/
|
||||
String fetch(Integer id);
|
||||
String fetch(int id);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user