From 5efc2e4f31e3456e68ac19fe21352ac501302bf4 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Thu, 18 Aug 2022 08:55:25 +0200 Subject: refact(sl20): switch to one single JSONMapper instsance --- .../gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java') diff --git a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java index 2b6ddb96..96fd34e8 100644 --- a/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java +++ b/eaaf_modules/eaaf_module_auth_sl20/src/main/java/at/gv/egiz/eaaf/modules/auth/sl20/utils/SL20HttpBindingUtils.java @@ -33,7 +33,6 @@ import lombok.Getter; public class SL20HttpBindingUtils { private static final Logger log = LoggerFactory.getLogger(SL20HttpBindingUtils.class); - private static JsonMapper mapper = new JsonMapper(); @Data @Getter @@ -81,7 +80,7 @@ public class SL20HttpBindingUtils { } final String sl20RespString = new URIBuilder(locationHeader[0].getValue()).getQueryParams().get(0).getValue(); - return new Sl20ResponseHolder(mapper.getMapper().readTree(Base64Url.decode(sl20RespString)), + return new Sl20ResponseHolder(JsonMapper.getMapper().readTree(Base64Url.decode(sl20RespString)), response.getStatusLine()); } else if ( @@ -96,7 +95,7 @@ public class SL20HttpBindingUtils { bodyMsg = EntityUtils.toString(response.getEntity()); log.info("SL20 response with http-code: {0} and errorMsg: {1}", httpStatusCode, bodyMsg); Sl20ResponseHolder holder = new Sl20ResponseHolder( - mapper.getMapper().readTree(bodyMsg), response.getStatusLine()); + JsonMapper.getMapper().readTree(bodyMsg), response.getStatusLine()); return holder; } catch (final IOException | ParseException e) { @@ -175,7 +174,7 @@ public class SL20HttpBindingUtils { if (resp != null && resp.getContent() != null) { final String rawSL20Resp = EntityUtils.toString(resp); try { - final JsonNode sl20Resp = mapper.getMapper().readTree(rawSL20Resp); + final JsonNode sl20Resp = JsonMapper.getMapper().readTree(rawSL20Resp); if (sl20Resp != null) { return sl20Resp; -- cgit v1.2.3