Implemented update method

This commit is contained in:
Fabio Sinibaldi 2021-09-21 12:31:15 +02:00
parent a9677988dc
commit 6e15ea93cf
1 changed files with 11 additions and 1 deletions

View File

@ -177,7 +177,17 @@ public class DefaultMongoConcessioni implements MongoConcessioni{
@Override
public Concessione update(String id, String jsonUpdate) throws Exception {
throw new Exception("To implement");
log.info("Updating {} ",id);
log.debug("JSON is {} ",jsonUpdate);
Call<WebTarget,Concessione> call= endpoint -> {
Response resp= endpoint.path(id).
request(MediaType.APPLICATION_JSON).put(Entity.entity(jsonUpdate,
MediaType.APPLICATION_JSON));
return check(resp,Concessione.class);
};
Concessione toReturn = delegate.make(call);
log.debug("Updated {} is {} ",id,toReturn);
return toReturn;
}
@Override