From 109276403c80a84df1b720a0eb8be4952c32d1c1 Mon Sep 17 00:00:00 2001 From: stigus Date: Wed, 5 Jun 2024 09:47:06 +0200 Subject: [PATCH] Deployer litt logging for inntektsgenerator-service #deploy-inntektsmelding-generator-service --- .../util/XmlConverter.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/util/XmlConverter.java b/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/util/XmlConverter.java index ea46753e7b0..25b73eabf7f 100644 --- a/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/util/XmlConverter.java +++ b/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/util/XmlConverter.java @@ -26,6 +26,7 @@ private XmlConverter() { } public static String toXml(JAXBElement value, Class clazz) { + log.debug("Konverterer Jaxb element til XML: value: {}, clazz: {}", value, clazz.getName()); try { JAXBContext jaxbContext = JAXBContext.newInstance(clazz); @@ -55,21 +56,6 @@ public static boolean validate(String xml, Class clazz) { } } - - @SuppressWarnings("unchecked") - private static T toObject(String xml, Class clazz) { - try { - JAXBContext jaxbContext = JAXBContext.newInstance(clazz); - - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - - return (T) unmarshaller.unmarshal(new StringReader(xml)); - - } catch (JAXBException e) { - throw new JaxbToXmlException("klarte ikke å konvertere Jaxb element til Objekt", e); - } - } - public static BigDecimal toBigDecimal(Double value) { return nonNull(value) ? BigDecimal.valueOf(value) : null; @@ -89,4 +75,18 @@ public static LocalDate toLocalDate(LocalDateTime localDateTime) { return nonNull(localDateTime) ? localDateTime.toLocalDate() : null; } + + @SuppressWarnings("unchecked") + private static T toObject(String xml, Class clazz) { + try { + JAXBContext jaxbContext = JAXBContext.newInstance(clazz); + + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + + return (T) unmarshaller.unmarshal(new StringReader(xml)); + + } catch (JAXBException e) { + throw new JaxbToXmlException("klarte ikke å konvertere Jaxb element til Objekt", e); + } + } }