diff --git a/jmaqs-jacoco-reporting/pom.xml b/jmaqs-jacoco-reporting/pom.xml index 57909a6ce..274314a5a 100644 --- a/jmaqs-jacoco-reporting/pom.xml +++ b/jmaqs-jacoco-reporting/pom.xml @@ -1,8 +1,4 @@ - - @@ -57,7 +53,6 @@ - com.magenic.jmaqs.appium @@ -79,6 +74,10 @@ com.magenic.jmaqs.webservices jmaqs-webservices-jdk8 + + com.magenic.jmaqs.webservices + jmaqs-webservices-jdk11 + com.magenic.jmaqs.database jmaqs-database diff --git a/jmaqs-webservices-jdk11/pom.xml b/jmaqs-webservices-jdk11/pom.xml index fddb25130..9d838e36e 100644 --- a/jmaqs-webservices-jdk11/pom.xml +++ b/jmaqs-webservices-jdk11/pom.xml @@ -2,17 +2,18 @@ + 4.0.0 jmaqs-framework com.magenic.jmaqs ${revision} - 4.0.0 com.magenic.jmaqs.webservices jmaqs-webservices-jdk11 - + JMAQS JDK11 WebServices Testing Module ${revision} + com.magenic.jmaqs.utilities @@ -33,8 +34,6 @@ - JMAQS JDK11 WebServices Testing Module - @@ -42,7 +41,6 @@ maven-compiler-plugin 3.8.1 - 11 11 diff --git a/jmaqs-webservices-jdk11/src/main/java/com/magenic/jmaqs/webservices/jdk11/WebServiceUtilities.java b/jmaqs-webservices-jdk11/src/main/java/com/magenic/jmaqs/webservices/jdk11/WebServiceUtilities.java index 1f6c7fae8..b2a4c85ef 100644 --- a/jmaqs-webservices-jdk11/src/main/java/com/magenic/jmaqs/webservices/jdk11/WebServiceUtilities.java +++ b/jmaqs-webservices-jdk11/src/main/java/com/magenic/jmaqs/webservices/jdk11/WebServiceUtilities.java @@ -27,6 +27,11 @@ public class WebServiceUtilities { */ private static final ObjectMapper xmlMapper = new XmlMapper(); + /** + * Error exception message. + */ + private static final String EXCEPTION_MESSAGE = "Only xml and json conversions are currently supported"; + /** * private class constructor. */ @@ -61,14 +66,14 @@ public static T getResponseBody(HttpResponse response, MediaType con responseBody = deserializeXml(response, type); } else { throw new IllegalArgumentException( - StringProcessor.safeFormatter("Only xml and json conversions are currently supported")); + StringProcessor.safeFormatter(EXCEPTION_MESSAGE)); } return responseBody; } /** - * Create string entity string entity. + * Create a string entity. * * @param the type parameter * @param body the body @@ -85,7 +90,7 @@ public static String createStringEntity(T body, MediaType contentType) throw return body.toString(); } else { throw new IllegalArgumentException( - StringProcessor.safeFormatter("Only xml and json conversions are currently supported")); + StringProcessor.safeFormatter(EXCEPTION_MESSAGE)); } } @@ -116,21 +121,21 @@ public static String serializeXml(T body) throws JsonProcessingException { /** * Deserialize the response based on the media type. * @param the type parameter - * @param message the String Http Response message + * @param response the String Http Response message * @param mediaType the type the message is going to be turned into * @param type the class or java object to be transferred into * @return the response type * @throws IOException the io exception */ - public static T deserializeResponse(HttpResponse message, MediaType mediaType, Type type) + public static T deserializeResponse(HttpResponse response, MediaType mediaType, Type type) throws IOException { if (mediaType.equals(MediaType.APP_XML)) { - return deserializeXml(message, type); + return deserializeXml(response, type); } else if (mediaType.equals(MediaType.APP_JSON)) { - return deserializeJson(message, type); + return deserializeJson(response, type); } else { throw new IllegalArgumentException( - StringProcessor.safeFormatter("Only xml and json conversions are currently supported")); + StringProcessor.safeFormatter(EXCEPTION_MESSAGE)); } } diff --git a/pom.xml b/pom.xml index 9500b3aca..c8526dc58 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ jmaqs-base jmaqs-selenium jmaqs-webservices-jdk8 + jmaqs-webservices-jdk11 jmaqs-appium jmaqs-database jmaqs-cucumber @@ -317,6 +318,11 @@ jmaqs-webservices-jdk8 ${project.version} + + com.magenic.jmaqs.webservices + jmaqs-webservices-jdk11 + ${project.version} +