authorizationMap = gson.fromJson(jsonFromMS, authorization);
diff --git a/src/test/restclient/JerseyClient.java b/src/test/restclient/JerseyClient.java
index eb99c52..46fb03e 100644
--- a/src/test/restclient/JerseyClient.java
+++ b/src/test/restclient/JerseyClient.java
@@ -19,8 +19,7 @@ public class JerseyClient {
public void obtainJSONResponse() throws ClientProtocolException, IOException {
- // invoking REST service with GET Method
-
+ // Invoke REST service with GET Method
ClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
diff --git a/src/test/restclient/JerseyClientPost.java b/src/test/restclient/JerseyClientPost.java
index 8c36562..4b58e7f 100644
--- a/src/test/restclient/JerseyClientPost.java
+++ b/src/test/restclient/JerseyClientPost.java
@@ -9,10 +9,8 @@ public class JerseyClientPost {
public static void main(String[] args) {
try {
-
Client client = Client.create();
- WebResource webResource = client
- .resource("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
+ WebResource webResource = client.resource("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
diff --git a/src/test/restclient/JerseyJsonResponse.java b/src/test/restclient/JerseyJsonResponse.java
index f04a585..9521ae6 100644
--- a/src/test/restclient/JerseyJsonResponse.java
+++ b/src/test/restclient/JerseyJsonResponse.java
@@ -5,9 +5,8 @@
import com.sun.jersey.api.client.WebResource;
public class JerseyJsonResponse {
-
- public static void main(String[] args) {
+ public static void main(String[] args) {
try {
String baseuri = "https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login/";
Client client = Client.create();
@@ -17,11 +16,12 @@ public static void main(String[] args) {
String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
// POST method
- ClientResponse response = webResource.accept("application/json").type("application/json").post(ClientResponse.class, input);
+ ClientResponse response = webResource.accept("application/json").type("type:application/json")
+ .post(ClientResponse.class, input);
// check response status code
if (response.getStatus() != 200) {
- throw new RuntimeException("Failed : HTTP error code : "+ response.getStatus());
+ throw new RuntimeException("Failed : HTTP error code : " + response.getStatus());
}
// display response
@@ -32,8 +32,5 @@ public static void main(String[] args) {
e.printStackTrace();
}
- }
-
+ } // main()
}
-
-
diff --git a/src/test/restclient/TestJSONResponse.java b/src/test/restclient/TestJSONResponse.java
index 46de1f6..fec4be0 100644
--- a/src/test/restclient/TestJSONResponse.java
+++ b/src/test/restclient/TestJSONResponse.java
@@ -14,48 +14,49 @@
public class TestJSONResponse {
public static void main(String[] args) throws MalformedURLException {
- //URL url = new URL("https://graph.facebook.com/search?q=java&type=post");
- //URL url = new URL("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
-
- //try (InputStream is = url.openStream(); JsonParser parser = Json.createParser(is)) {
+ // URL url = new URL("https://graph.facebook.com/search?q=java&type=post");
+ // URL url = new
+ // URL("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
+
+ // try (InputStream is = url.openStream(); JsonParser parser =
+ // Json.createParser(is)) {
try {
- URL url = new URL("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
- conn.setDoOutput(true);
- conn.setRequestMethod("POST");
- conn.setRequestProperty("Content-Type", "application/json");
-
- String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
-
- OutputStream os = conn.getOutputStream();
- // 1.The client sends their credentials (username and password) to the server.
- os.write(input.getBytes());
- os.flush();
-
- BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
-
- JsonParser parser = (JsonParser) Json.createReader(br);
-
+ URL url = new URL("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/json");
+
+ String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
+
+ OutputStream os = conn.getOutputStream();
+ // 1.The client sends their credentials (username and password) to the server.
+ os.write(input.getBytes());
+ os.flush();
+
+ BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
+
+ JsonParser parser = (JsonParser) Json.createReader(br);
+
while (parser.hasNext()) {
Event e = parser.next();
if (e == Event.KEY_NAME) {
switch (parser.getString()) {
- case "RefreshToken":
- parser.next();
- System.out.print(parser.getString());
- System.out.print(": ");
- break;
- case "IdToken":
- parser.next();
- System.out.println(parser.getString());
- System.out.println("---------");
- break;
+ case "RefreshToken":
+ parser.next();
+ System.out.print(parser.getString());
+ System.out.print(": ");
+ break;
+ case "IdToken":
+ parser.next();
+ System.out.println(parser.getString());
+ System.out.println("---------");
+ break;
}
}
}
- } catch (Exception e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
}
diff --git a/src/test/restclient/TestRestClient.java b/src/test/restclient/TestRestClient.java
index db047ad..342011d 100644
--- a/src/test/restclient/TestRestClient.java
+++ b/src/test/restclient/TestRestClient.java
@@ -5,9 +5,9 @@
import com.sun.jersey.api.client.WebResource;
public class TestRestClient {
- string AWS_URL="https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login";
+ string AWS_URL = "https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login";
- public void cheackServerAvailable(){
+ public void checkServiceAvailability() {
}
@@ -16,7 +16,7 @@ public void testAWSConnectAPI() {
try {
Client client = Client.create();
- WebResource webResource = client.resource(+ AWS_URL);
+ WebResource webResource = client.resource(+AWS_URL);
String input = "{\"id\":\"10295765\",\"password\":\"TestPassword!12\"}";
ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
diff --git a/src/test/ux/AttendanceGenerateTest.java b/src/test/ux/AttendanceGenerateTest.java
index 426478a..df73971 100644
--- a/src/test/ux/AttendanceGenerateTest.java
+++ b/src/test/ux/AttendanceGenerateTest.java
@@ -10,6 +10,5 @@ public class AttendanceGenerateTest {
public void testRandomCode() {
AttendanceBean at = new AttendanceBean();
assertNotNull("data", at.generateAttendanceCode());
- }
-
+ } // testRandomCode()
}
diff --git a/src/test/wsclient/GeoIP.java b/src/test/wsclient/GeoIP.java
index 0e9bf9a..1e66ceb 100644
--- a/src/test/wsclient/GeoIP.java
+++ b/src/test/wsclient/GeoIP.java
@@ -1,7 +1,7 @@
- /**
- * Class GeoIP imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class GeoIP imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -10,11 +10,13 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-
/**
- * Java class for GeoIP complex type.
+ *
+ * Java class for GeoIP complex type.
*
- *
The following schema fragment specifies the expected content contained within this class.
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
*
*
* <complexType name="GeoIP">
@@ -36,11 +38,11 @@
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GeoIP", propOrder = {
- "returnCode",
- "ip",
- "returnCodeDetails",
- "countryName",
- "countryCode"
+ "returnCode",
+ "ip",
+ "returnCodeDetails",
+ "countryName",
+ "countryCode"
})
public class GeoIP {
@@ -75,9 +77,9 @@ public void setReturnCode(int value) {
* Gets the value of the ip property.
*
* @return
- * possible object is
- * {@link String }
- *
+ * possible object is
+ * {@link String }
+ *
*/
public String getIP() {
return ip;
@@ -87,9 +89,9 @@ public String getIP() {
* Sets the value of the ip property.
*
* @param value
- * allowed object is
- * {@link String }
- *
+ * allowed object is
+ * {@link String }
+ *
*/
public void setIP(String value) {
this.ip = value;
@@ -99,9 +101,9 @@ public void setIP(String value) {
* Gets the value of the returnCodeDetails property.
*
* @return
- * possible object is
- * {@link String }
- *
+ * possible object is
+ * {@link String }
+ *
*/
public String getReturnCodeDetails() {
return returnCodeDetails;
@@ -111,9 +113,9 @@ public String getReturnCodeDetails() {
* Sets the value of the returnCodeDetails property.
*
* @param value
- * allowed object is
- * {@link String }
- *
+ * allowed object is
+ * {@link String }
+ *
*/
public void setReturnCodeDetails(String value) {
this.returnCodeDetails = value;
@@ -123,9 +125,9 @@ public void setReturnCodeDetails(String value) {
* Gets the value of the countryName property.
*
* @return
- * possible object is
- * {@link String }
- *
+ * possible object is
+ * {@link String }
+ *
*/
public String getCountryName() {
return countryName;
@@ -135,9 +137,9 @@ public String getCountryName() {
* Sets the value of the countryName property.
*
* @param value
- * allowed object is
- * {@link String }
- *
+ * allowed object is
+ * {@link String }
+ *
*/
public void setCountryName(String value) {
this.countryName = value;
@@ -147,9 +149,9 @@ public void setCountryName(String value) {
* Gets the value of the countryCode property.
*
* @return
- * possible object is
- * {@link String }
- *
+ * possible object is
+ * {@link String }
+ *
*/
public String getCountryCode() {
return countryCode;
@@ -159,9 +161,9 @@ public String getCountryCode() {
* Sets the value of the countryCode property.
*
* @param value
- * allowed object is
- * {@link String }
- *
+ * allowed object is
+ * {@link String }
+ *
*/
public void setCountryCode(String value) {
this.countryCode = value;
diff --git a/src/test/wsclient/GeoIPService.java b/src/test/wsclient/GeoIPService.java
index b3eecd0..7771643 100644
--- a/src/test/wsclient/GeoIPService.java
+++ b/src/test/wsclient/GeoIPService.java
@@ -1,7 +1,7 @@
- /**
- * Class GeoIPService imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class GeoIPService imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -14,7 +14,6 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
-
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.9-b130926.1035
@@ -23,8 +22,7 @@
*/
@WebServiceClient(name = "GeoIPService", targetNamespace = "http://www.webservicex.net/", wsdlLocation = "http://www.webservicex.net/geoipservice.asmx?WSDL")
public class GeoIPService
- extends Service
-{
+ extends Service {
private final static URL GEOIPSERVICE_WSDL_LOCATION;
private final static WebServiceException GEOIPSERVICE_EXCEPTION;
@@ -67,9 +65,8 @@ public GeoIPService(URL wsdlLocation, QName serviceName, WebServiceFeature... fe
}
/**
- *
* @return
- * returns GeoIPServiceSoap
+ * returns GeoIPServiceSoap
*/
@WebEndpoint(name = "GeoIPServiceSoap")
public GeoIPServiceSoap getGeoIPServiceSoap() {
@@ -79,20 +76,23 @@ public GeoIPServiceSoap getGeoIPServiceSoap() {
/**
*
* @param features
- * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features
parameter will have their default values.
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure
+ * on the proxy. Supported features not in the
+ * features
parameter will have their default
+ * values.
* @return
- * returns GeoIPServiceSoap
+ * returns GeoIPServiceSoap
*/
@WebEndpoint(name = "GeoIPServiceSoap")
public GeoIPServiceSoap getGeoIPServiceSoap(WebServiceFeature... features) {
- return super.getPort(new QName("http://www.webservicex.net/", "GeoIPServiceSoap"), GeoIPServiceSoap.class, features);
+ return super.getPort(new QName("http://www.webservicex.net/", "GeoIPServiceSoap"), GeoIPServiceSoap.class,
+ features);
}
private static URL __getWsdlLocation() {
- if (GEOIPSERVICE_EXCEPTION!= null) {
+ if (GEOIPSERVICE_EXCEPTION != null) {
throw GEOIPSERVICE_EXCEPTION;
}
return GEOIPSERVICE_WSDL_LOCATION;
}
-
}
diff --git a/src/test/wsclient/GeoIPServiceSoap.java b/src/test/wsclient/GeoIPServiceSoap.java
index af50614..22a84bb 100644
--- a/src/test/wsclient/GeoIPServiceSoap.java
+++ b/src/test/wsclient/GeoIPServiceSoap.java
@@ -1,7 +1,7 @@
- /**
- * Class GeoIPServiceSoap imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class GeoIPServiceSoap imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -13,7 +13,6 @@
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
-
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.9-b130926.1035
@@ -22,35 +21,35 @@
*/
@WebService(name = "GeoIPServiceSoap", targetNamespace = "http://www.webservicex.net/")
@XmlSeeAlso({
- ObjectFactory.class
+ ObjectFactory.class
})
public interface GeoIPServiceSoap {
/**
- * GeoIPService - GetGeoIP enables you to easily look up countries by IP addresses
+ * GeoIPService - GetGeoIP enables you to easily look up countries by IP
+ * addresses
*
* @param ipAddress
* @return
- * returns wsclient.GeoIP
+ * returns wsclient.GeoIP
*/
@WebMethod(operationName = "GetGeoIP", action = "http://www.webservicex.net/GetGeoIP")
@WebResult(name = "GetGeoIPResult", targetNamespace = "http://www.webservicex.net/")
@RequestWrapper(localName = "GetGeoIP", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIP")
@ResponseWrapper(localName = "GetGeoIPResponse", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIPResponse")
public GeoIP getGeoIP(
- @WebParam(name = "IPAddress", targetNamespace = "http://www.webservicex.net/")
- String ipAddress);
+ @WebParam(name = "IPAddress", targetNamespace = "http://www.webservicex.net/") String ipAddress);
/**
- * GeoIPService - GetGeoIPContext enables you to easily look up countries by Context
+ * GeoIPService - GetGeoIPContext enables you to easily look up countries by
+ * Context
*
* @return
- * returns wsclient.GeoIP
+ * returns wsclient.GeoIP
*/
@WebMethod(operationName = "GetGeoIPContext", action = "http://www.webservicex.net/GetGeoIPContext")
@WebResult(name = "GetGeoIPContextResult", targetNamespace = "http://www.webservicex.net/")
@RequestWrapper(localName = "GetGeoIPContext", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIPContext")
@ResponseWrapper(localName = "GetGeoIPContextResponse", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIPContextResponse")
public GeoIP getGeoIPContext();
-
}
diff --git a/src/test/wsclient/GetGeoIP.java b/src/test/wsclient/GetGeoIP.java
index fcb0571..ab3a42f 100644
--- a/src/test/wsclient/GetGeoIP.java
+++ b/src/test/wsclient/GetGeoIP.java
@@ -1,7 +1,7 @@
- /**
- * Class GetGeoIP imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class GetGeoIP imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -11,11 +11,13 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-
/**
- * Java class for anonymous complex type.
+ *
+ * Java class for anonymous complex type.
*
- *
The following schema fragment specifies the expected content contained within this class.
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
*
*
* <complexType>
@@ -34,7 +36,7 @@
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
- "ipAddress"
+ "ipAddress"
})
@XmlRootElement(name = "GetGeoIP")
public class GetGeoIP {
@@ -46,9 +48,9 @@ public class GetGeoIP {
* Gets the value of the ipAddress property.
*
* @return
- * possible object is
- * {@link String }
- *
+ * possible object is
+ * {@link String }
+ *
*/
public String getIPAddress() {
return ipAddress;
@@ -58,9 +60,9 @@ public String getIPAddress() {
* Sets the value of the ipAddress property.
*
* @param value
- * allowed object is
- * {@link String }
- *
+ * allowed object is
+ * {@link String }
+ *
*/
public void setIPAddress(String value) {
this.ipAddress = value;
diff --git a/src/test/wsclient/GetGeoIPContextResponse.java b/src/test/wsclient/GetGeoIPContextResponse.java
index 0fbb17b..eabac05 100644
--- a/src/test/wsclient/GetGeoIPContextResponse.java
+++ b/src/test/wsclient/GetGeoIPContextResponse.java
@@ -1,7 +1,7 @@
- /**
- * Class getGeoIPContextResult imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class getGeoIPContextResult imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -11,11 +11,13 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-
/**
- * Java class for anonymous complex type.
+ *
+ * Java class for anonymous complex type.
*
- *
The following schema fragment specifies the expected content contained within this class.
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
*
*
* <complexType>
@@ -28,12 +30,11 @@
* </complexContent>
* </complexType>
*
- *
- *
*/
+
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
- "getGeoIPContextResult"
+ "getGeoIPContextResult"
})
@XmlRootElement(name = "GetGeoIPContextResponse")
public class GetGeoIPContextResponse {
@@ -45,9 +46,9 @@ public class GetGeoIPContextResponse {
* Gets the value of the getGeoIPContextResult property.
*
* @return
- * possible object is
- * {@link GeoIP }
- *
+ * possible object is
+ * {@link GeoIP }
+ *
*/
public GeoIP getGetGeoIPContextResult() {
return getGeoIPContextResult;
@@ -57,9 +58,9 @@ public GeoIP getGetGeoIPContextResult() {
* Sets the value of the getGeoIPContextResult property.
*
* @param value
- * allowed object is
- * {@link GeoIP }
- *
+ * allowed object is
+ * {@link GeoIP }
+ *
*/
public void setGetGeoIPContextResult(GeoIP value) {
this.getGeoIPContextResult = value;
diff --git a/src/test/wsclient/GetGeoIPResponse.java b/src/test/wsclient/GetGeoIPResponse.java
index e5e621e..fa15f74 100644
--- a/src/test/wsclient/GetGeoIPResponse.java
+++ b/src/test/wsclient/GetGeoIPResponse.java
@@ -1,7 +1,7 @@
- /**
- * Class getGeoIPResult imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class getGeoIPResult imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -12,9 +12,12 @@
import javax.xml.bind.annotation.XmlType;
/**
- * Java class for anonymous complex type.
+ *
+ * Java class for anonymous complex type.
*
- *
The following schema fragment specifies the expected content contained within this class.
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
*
*
* <complexType>
@@ -32,7 +35,7 @@
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
- "getGeoIPResult"
+ "getGeoIPResult"
})
@XmlRootElement(name = "GetGeoIPResponse")
public class GetGeoIPResponse {
@@ -44,9 +47,9 @@ public class GetGeoIPResponse {
* Gets the value of the getGeoIPResult property.
*
* @return
- * possible object is
- * {@link GeoIP }
- *
+ * possible object is
+ * {@link GeoIP }
+ *
*/
public GeoIP getGetGeoIPResult() {
return getGeoIPResult;
@@ -56,12 +59,11 @@ public GeoIP getGetGeoIPResult() {
* Sets the value of the getGeoIPResult property.
*
* @param value
- * allowed object is
- * {@link GeoIP }
- *
+ * allowed object is
+ * {@link GeoIP }
+ *
*/
public void setGetGeoIPResult(GeoIP value) {
this.getGeoIPResult = value;
}
-
-}
+}
\ No newline at end of file
diff --git a/src/test/wsclient/ObjectFactory.java b/src/test/wsclient/ObjectFactory.java
index 0c8da64..a81a6eb 100644
--- a/src/test/wsclient/ObjectFactory.java
+++ b/src/test/wsclient/ObjectFactory.java
@@ -1,7 +1,7 @@
- /**
- * Class ObjectFactory imported from WSDL with java tool
- * replicates WSDL to invoke External Web service
- */
+/**
+ * Class ObjectFactory imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
package wsclient;
@@ -10,18 +10,18 @@
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
-
/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the wsclient package.
- * An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the wsclient package.
+ *
+ * An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
* provided in this class.
*
*/
@@ -31,7 +31,8 @@ public class ObjectFactory {
private final static QName _GeoIP_QNAME = new QName("http://www.webservicex.net/", "GeoIP");
/**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: wsclient
+ * Create a new ObjectFactory that can be used to create new instances of schema
+ * derived classes for package: wsclient
*
*/
public ObjectFactory() {
diff --git a/src/test/wsdl/ServiceInvokationTest.java b/src/test/wsdl/ServiceInvokationTest.java
index ff82ba3..848ec17 100644
--- a/src/test/wsdl/ServiceInvokationTest.java
+++ b/src/test/wsdl/ServiceInvokationTest.java
@@ -9,20 +9,20 @@
import service.MainService;
public class ServiceInvokationTest {
-
+
MainService testService = new MainService();
AttendanceRegister attend = new AttendanceRegister();
@Test
public void testWSDLSuccess() {
-
- assertTrue(testService.invokeWSDLForIP().length()>2);
- //System.out.println(testService.invokeWSDLForIP());
+
+ assertTrue(testService.invokeWSDLForIP().length() > 2);
+ // System.out.println(testService.invokeWSDLForIP());
}
-
+
@Test
public void testRestBibleSuccess() {
- assertTrue(testService.invokeRestForBibleVerse().length()>2);
- //System.out.println(testService.invokeRestForBibleVerse());
+ assertTrue(testService.invokeRestForBibleVerse().length() > 2);
+ // System.out.println(testService.invokeRestForBibleVerse());
}
}
From 8d693f03b1320605c5942a61f23d3e527fb3b3f0 Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Mon, 10 Jul 2023 21:40:47 +1200
Subject: [PATCH 04/32] instructions when using docker
---
README.md | 78 ++++++++++++++++++++++++++++++-------------------------
1 file changed, 43 insertions(+), 35 deletions(-)
diff --git a/README.md b/README.md
index 7ac018d..f26881e 100644
--- a/README.md
+++ b/README.md
@@ -5,10 +5,12 @@
- [Attendance WebApp UI](#attendance-webapp-ui)
- [Refer to the Wiki for details on the project](#refer-to-the-wiki-for-details-on-the-project)
- [Project general guidelines](#project-general-guidelines)
-- [Build and Test](#build-and-test)
- - [Maven](#maven)
+ - [Locally Build and Test](#locally-build-and-test)
+ - [Maven Stages](#maven-stages)
- [Run the maven build Locally](#run-the-maven-build-locally)
- - [Build using maven docker container](#build-using-maven-docker-container)
+ - [Docker](#docker)
+ - [Run and test the container webapp](#run-and-test-the-container-webapp)
+ - [Build using maven docker container](#build-using-maven-docker-container)
- [GitHub Vulnerability report](#github-vulnerability-report)
# Attendance WebApp
@@ -59,64 +61,70 @@ To find out more, visit:
3. Latest releases by using git tags
4. API references. API docs
-# Build and Test
-
+## Locally Build and Test
+> Tested in Win11 with WSL
+- Clone git repo
```bash
git clone repo
-# import in IDE Eclipse suggested or use online IDE
-# execute some of the unit tests
-# Generate the .WAR file
-mvn package
-# Deploy WebArchive file in tomcat. Docker apps info below
-deploy .WAR in tomcat
```
-## Maven
-
-### Run the maven build Locally
-
-- build the project locally with a locally installed maven client
-
-> Tested in Win11 with WSL
+- open in IDE Eclipse, IntelliJ (suggested) or use online IDE (Github codespaces)
-```bash
-mvn verify
+- Pack the WebArchive file using maven. Generate the .WAR file
+``` bash
+mvn package
```
-- Use a docker tag to select a target JDK
-
-> 8-jdk8-corretto
-
+- Build the app image with Docker. Deploy .WAR file in Tomcat
+refer to https://hub.docker.com/_/tomcat
```bash
TOMCAT_DOCKER_TAG="8-jdk8-corretto"
+docker build --tag aleon1220/soa:latest .
```
-- build the container to the latest version tag
+- Run the tomcat server with the pre-built WAR web Archive file
+ Use the tag latest or a particular version e.g. aleon1220/soa:v2 or aleon1220/soa:latest
```bash
-docker build --tag aleon1220/soa:latest .
+docker run -itd --publish 8888:8080 aleon1220/soa:latest
+```
+- get the name of the running container in port 8888
+``` bash
+CONTAINER_NAME=$(docker container ls --all --filter publish=8888 --format "{{.Names}}")
```
-- Run the tomcat server with the pre-built WAR web Archive file
- Use the tag latest or a particular version e.g. aleon1220/soa:v2 or aleon1220/soa:latest
+- Access the Docker container via CLI
```bash
-docker run -itd --publish 8888:8080 --name attendance_webapp_container aleon1220/soa:latest
+docker container exec -it $CONTAINER_NAME /bin/bash
```
-refer to https://hub.docker.com/_/tomcat
+- The URl is URL:8888/AttendanceWebApp [AttendanceWebApp](http://localhost:8888/AttendanceWebApp)
-- Access container
-```bash
-docker container exec -it aleon1220/soa /bin/bash
+- clean up docker container environment
+``` bash
+docker stop $(docker ps --quiet)
+docker rm $(docker container ls --all --quiet)
```
+## Maven Stages
-- The URl is localhost:8888/AttendanceWebApp | [AttendanceWebApp](http://localhost:8888/AttendanceWebApp)
+### Run the maven build Locally
+- build the project locally with a locally installed maven client
+
+```bash
+mvn verify
+```
---
-## Build using maven docker container
+## Docker
+### Run and test the container webapp
+```bash
+docker build --tag aleon1220/soa:latest .
+docker run -itd --publish 8888:8080 --name attendance_webapp_container aleon1220/soa:latest
+```
+### Build using maven docker container
Refer to maven docker official image https://hub.docker.com/_/maven
is best to have maven locally installed
From 732303ecea0ac1e697d8eb882d2d7104a5a07d3f Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Wed, 12 Jul 2023 18:26:50 +1200
Subject: [PATCH 05/32] Implement Gradle for the build
moves maven files to respective directory
Readme is updated with instructions
---
.gitignore | 18 +++++++++-
Dockerfile | 7 ++--
README.md | 33 +++++++++++------
build.gradle.kts | 77 ++++++++++++++++++++++++++++++++++++++++
gradle.properties | 3 ++
maven/Dockerfile | 7 ++++
pom.xml => maven/pom.xml | 2 --
settings.gradle.kts | 7 ++++
8 files changed, 137 insertions(+), 17 deletions(-)
create mode 100644 build.gradle.kts
create mode 100644 gradle.properties
create mode 100644 maven/Dockerfile
rename pom.xml => maven/pom.xml (99%)
create mode 100644 settings.gradle.kts
diff --git a/.gitignore b/.gitignore
index 12924fc..7b16d59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,26 @@
+# Gradle
+**/build/
+!src/**/build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+# Avoid ignore Gradle wrappper properties
+!gradle-wrapper.properties
+
+# Cache of project
+.gradletasknamecache
+
#.config file for eclipse projects
.settings
/.classpath
/bin/
/.project
-#target with generated objects
+# Maven build files
/target
# Compiled class file
diff --git a/Dockerfile b/Dockerfile
index 629b2f7..f51d8c7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,8 @@
FROM tomcat:8-jdk8-corretto
# https://hub.docker.com/layers/library/tomcat/7.0.109-jdk8-openjdk/images/sha256-489823486120d076cb576640c5819c6fa54948f470b46c54f02b48f462eb2c23
LABEL org.nz.itlatinos.image.authors="aleonrangel@outlook.co.nz"
-ADD conf/tomcat-users.xml /usr/local/tomcat/conf
+LABEL maintainer="andres.nz"
+ENV APP_WAR_FILE="AttendanceApp-0.0.1.war"
-COPY target/AttendanceWebApp.war /usr/local/tomcat/webapps/
-LABEL maintainer="andres.nz"
\ No newline at end of file
+# Tomcat Custom settings
+COPY "build/libs/$APP_WAR_FILE" /usr/local/tomcat/webapps/
\ No newline at end of file
diff --git a/README.md b/README.md
index f26881e..99feb37 100644
--- a/README.md
+++ b/README.md
@@ -56,35 +56,46 @@ To find out more, visit:
# Project general guidelines
-1. Installation process: project is Maven java project. Import in any IDE with the POM File.
+1. Installation process: project a Java project JEE. Import in any IDE and build with gradle or maven. Build docker image and run
2. Software dependencies: dependencies are described in pom.xml file
3. Latest releases by using git tags
4. API references. API docs
-## Locally Build and Test
-> Tested in Win11 with WSL
-- Clone git repo
+## Setup
+> Tested in Win11 with WSL, Github codespaces and Ubuntu22
+
+- Clone repo
```bash
git clone repo
```
-- open in IDE Eclipse, IntelliJ (suggested) or use online IDE (Github codespaces)
+- open repo in chosen IDE
+IDEs can be Eclipse, IntelliJ (suggested) or use online IDE (Github codespaces)
-- Pack the WebArchive file using maven. Generate the .WAR file
+## Build Web Package
+- Pack the WebArchive file. Generate the .WAR file
``` bash
-mvn package
+gradle clean build --console plain --warning-mode all
```
+### Maven Build
+> maven has been deprecated and moved to [maven](./maven)
+if you still want to build with maven run `mvn package`
+
+## Docker Image Build
- Build the app image with Docker. Deploy .WAR file in Tomcat
refer to https://hub.docker.com/_/tomcat
```bash
-TOMCAT_DOCKER_TAG="8-jdk8-corretto"
docker build --tag aleon1220/soa:latest .
```
-- Run the tomcat server with the pre-built WAR web Archive file
- Use the tag latest or a particular version e.g. aleon1220/soa:v2 or aleon1220/soa:latest
+### Available Tomcat versions
+Use the tag latest or a particular version e.g. aleon1220/soa:v2 or aleon1220/soa:latest
+- 7.0.109 = `TOMCAT_VERSION_DOCKER_TAG="7.0.109-jdk8-openjdk"`
+- 9.0.78 = `TOMCAT_VERSION_DOCKER_TAG="9.0.78-jre8"`
+## Docker execution
+Run the tomcat server with the pre-built WAR web Archive file
```bash
docker run -itd --publish 8888:8080 aleon1220/soa:latest
```
@@ -99,7 +110,7 @@ CONTAINER_NAME=$(docker container ls --all --filter publish=8888 --format "{{.Na
docker container exec -it $CONTAINER_NAME /bin/bash
```
-- The URl is URL:8888/AttendanceWebApp [AttendanceWebApp](http://localhost:8888/AttendanceWebApp)
+- The URl is URL:8888/Attendance-0.0.1 [AttendanceWebApp](http://localhost:8888/Attendance-0.0.1)
- clean up docker container environment
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..21b81ae
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,77 @@
+import org.gradle.api.tasks.testing.logging.TestExceptionFormat
+import org.gradle.api.tasks.testing.logging.TestLogEvent
+
+/*
+ * This file was generated by the Gradle 'init' task.
+ *
+ * This project uses @Incubating APIs which are subject to change.
+ */
+
+plugins {
+ java
+ id ("com.adarshr.test-logger") version "3.0.0"
+ // https://docs.gradle.org/7.3/dsl/org.gradle.api.tasks.bundling.War.html
+ war
+}
+
+repositories {
+ mavenCentral()
+ mavenLocal()
+ maven {
+ url = uri("https://repository.primefaces.org")
+ }
+ // maven { // url = uri("https://repo.maven.apache.org/maven2/") // }
+}
+
+dependencies {
+ implementation("org.primefaces.extensions:primefaces-extensions:6.0.0")
+ implementation("org.primefaces:primefaces:6.0")
+ implementation("com.sun.faces:jsf-api:2.2.12")
+ implementation("com.sun.faces:jsf-impl:2.2.12")
+ implementation("javax.json:javax.json-api:1.1")
+ implementation("javax.ws.rs:javax.ws.rs-api:2.1")
+ implementation("com.sun.jersey:jersey-client:1.19.4")
+ implementation("com.google.code.gson:gson:2.8.9")
+ implementation("org.apache.httpcomponents:httpclient:4.5.3")
+ implementation("org.glassfish.jersey.core:jersey-common:2.22.2")
+ implementation("javax.servlet:javax.servlet-api:3.1.0")
+ testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
+ testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
+ testImplementation("io.jsonwebtoken:jjwt:0.7.0")
+}
+
+group = "soa.nz.aut"
+version = "0.0.1"
+description = "Class Attendance WebApp"
+java.sourceCompatibility = JavaVersion.VERSION_1_8
+
+tasks.war {
+ archiveBaseName.set("Attendance")
+ webAppDirectory.set(file("src/main/webapp"))
+ // from("src/rootContent") // adds a file-set to the root of the archive
+ // webInf { from("src/additionalWebInf") } // adds a file-set to the WEB-INF dir.
+ // classpath(fileTree("additionalLibs")) // adds a file-set to the WEB-INF/lib dir.
+ // classpath(moreLibs) // adds a configuration to the WEB-INF/lib dir.
+ // webXml = file("src/someWeb.xml") // copies a file to WEB-INF/web.xml
+}
+
+tasks {
+ test {
+ useJUnitPlatform()
+ testLogging.events = setOf(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED)
+ }
+}
+
+// task{
+// testlogger{
+// setTheme("mocha")
+// showExceptions=true
+// showStackTraces=true
+// }
+// }
+
+// afterEvaluate {
+// tasks.getByName("run") {
+// dependsOn("appRun")
+// }
+// }
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..eca1768
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,3 @@
+log4j_version = 1.2.17
+jaxb_version = 2.3.1
+junit_version = 5.5.1
diff --git a/maven/Dockerfile b/maven/Dockerfile
new file mode 100644
index 0000000..629b2f7
--- /dev/null
+++ b/maven/Dockerfile
@@ -0,0 +1,7 @@
+FROM tomcat:8-jdk8-corretto
+# https://hub.docker.com/layers/library/tomcat/7.0.109-jdk8-openjdk/images/sha256-489823486120d076cb576640c5819c6fa54948f470b46c54f02b48f462eb2c23
+LABEL org.nz.itlatinos.image.authors="aleonrangel@outlook.co.nz"
+ADD conf/tomcat-users.xml /usr/local/tomcat/conf
+
+COPY target/AttendanceWebApp.war /usr/local/tomcat/webapps/
+LABEL maintainer="andres.nz"
\ No newline at end of file
diff --git a/pom.xml b/maven/pom.xml
similarity index 99%
rename from pom.xml
rename to maven/pom.xml
index cce3041..209ca25 100644
--- a/pom.xml
+++ b/maven/pom.xml
@@ -86,7 +86,6 @@
gson
2.8.9
-
org.apache.httpcomponents
@@ -100,7 +99,6 @@
2.22.2
compile
-
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..dbab213
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,7 @@
+/*
+ * This file was generated by the Gradle 'init' task.
+ *
+ * This project uses @Incubating APIs which are subject to change.
+ */
+
+rootProject.name = "AttendWebApp"
\ No newline at end of file
From 96bf9585035ab77d92b1d3f6b4623d78ea384cb3 Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Mon, 31 Jul 2023 18:44:44 +1200
Subject: [PATCH 06/32] enable diagrams.net develop branch
---
README.md | 12 ++-
project-diagrams.drawio | 177 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 188 insertions(+), 1 deletion(-)
create mode 100644 project-diagrams.drawio
diff --git a/README.md b/README.md
index 99feb37..40d722e 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,18 @@
- [Attendance WebApp UI](#attendance-webapp-ui)
- [Refer to the Wiki for details on the project](#refer-to-the-wiki-for-details-on-the-project)
- [Project general guidelines](#project-general-guidelines)
- - [Locally Build and Test](#locally-build-and-test)
+ - [Setup](#setup)
+ - [Build Web Package](#build-web-package)
+ - [Maven Build](#maven-build)
+ - [Docker Image Build](#docker-image-build)
+ - [Available Tomcat versions](#available-tomcat-versions)
+ - [Docker execution](#docker-execution)
- [Maven Stages](#maven-stages)
- [Run the maven build Locally](#run-the-maven-build-locally)
- [Docker](#docker)
- [Run and test the container webapp](#run-and-test-the-container-webapp)
- [Build using maven docker container](#build-using-maven-docker-container)
+ - [Editing project diagrams](#editing-project-diagrams)
- [GitHub Vulnerability report](#github-vulnerability-report)
# Attendance WebApp
@@ -164,6 +170,10 @@ docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr
docker run -it --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.3-jdk-8 mvn clean install
```
+## Editing project diagrams
+- go to [diagrams.net](https://app.diagrams.net/?src=about)
+- open the file [project-diagrams.drawio](./project-diagrams.drawio) XML file with the diagrams
+- Explore > export images to convinience and update this README
## GitHub Vulnerability report
https://github.com/aleon1220/multi-cloud-WebApp-Attendance/security/dependabot
diff --git a/project-diagrams.drawio b/project-diagrams.drawio
new file mode 100644
index 0000000..21e212e
--- /dev/null
+++ b/project-diagrams.drawio
@@ -0,0 +1,177 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 18ffaaadee9ddfd7712ef9a1b28368ec2f8b0a34 Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Tue, 1 Aug 2023 18:41:57 +1200
Subject: [PATCH 07/32] Sitemap & wireframes added
---
project-diagrams.drawio | 153 ++++++++++++++++++++++++++++++++--------
1 file changed, 124 insertions(+), 29 deletions(-)
diff --git a/project-diagrams.drawio b/project-diagrams.drawio
index 21e212e..98f894e 100644
--- a/project-diagrams.drawio
+++ b/project-diagrams.drawio
@@ -1,75 +1,81 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -174,4 +180,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 0576fa42289ac2d10a029ffad2781a930082752f Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Tue, 1 Aug 2023 18:42:41 +1200
Subject: [PATCH 08/32] gradle wrapper
---
gradle/wrapper/gradle-wrapper.properties | 5 +
gradlew | 234 +++++++++++++++++++++++
gradlew.bat | 89 +++++++++
3 files changed, 328 insertions(+)
create mode 100644 gradle/wrapper/gradle-wrapper.properties
create mode 100644 gradlew
create mode 100644 gradlew.bat
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..2e6e589
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..1b6c787
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,234 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
+APP_BASE_NAME=${0##*/}
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..ac1b06f
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,89 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
From b2e9c89a3247c22a44c355629b3e1afb4f3cf57f Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Thu, 3 Aug 2023 18:02:24 +1200
Subject: [PATCH 09/32] Redesigned app based on sitemap
sitemap defines interaction flow in page
Renamed files to have them in order for teaching purposes
---
project-diagrams | 103 -----
project-diagrams.drawio | 435 +++++++++++++-----
.../webapp/{login.xhtml => 01-login.xhtml} | 0
src/main/webapp/02-studentHome.xhtml | 106 +++++
...tendanceOK.xhtml => 03-attendanceOK.xhtml} | 0
...ceRegister.xhtml => 04-lecturerHome.xhtml} | 0
.../{main.xhtml => 05-universityStaff.xhtml} | 0
.../webapp/{sign.xhtml => 06-Reports.xhtml} | 0
...test2.xhtml => 07-StudentManagement.xhtml} | 0
...mponent.xhtml => 08-ClassManagement.xhtml} | 0
src/main/webapp/09-UserManagement.xhtml | 47 ++
src/main/webapp/10-CompositeServices.xhtml | 47 ++
src/main/webapp/404-attendanceError.xhtml | 108 +++++
...{loginError.xhtml => 404-loginError.xhtml} | 0
src/main/webapp/UserCreated.xhtml | 37 --
src/main/webapp/WEB-INF/web.xml | 16 +-
src/main/webapp/attendanceError.xhtml | 82 ----
src/main/webapp/attendanceGenerate.xhtml | 91 ----
src/main/webapp/attendanceNOK.xhtml | 38 --
src/main/webapp/dropdown.xhtml | 37 --
src/main/webapp/helloworld.xhtml | 23 -
21 files changed, 625 insertions(+), 545 deletions(-)
delete mode 100644 project-diagrams
rename src/main/webapp/{login.xhtml => 01-login.xhtml} (100%)
create mode 100644 src/main/webapp/02-studentHome.xhtml
rename src/main/webapp/{attendanceOK.xhtml => 03-attendanceOK.xhtml} (100%)
rename src/main/webapp/{attendanceRegister.xhtml => 04-lecturerHome.xhtml} (100%)
rename src/main/webapp/{main.xhtml => 05-universityStaff.xhtml} (100%)
rename src/main/webapp/{sign.xhtml => 06-Reports.xhtml} (100%)
rename src/main/webapp/{test2.xhtml => 07-StudentManagement.xhtml} (100%)
rename src/main/webapp/{testComponent.xhtml => 08-ClassManagement.xhtml} (100%)
create mode 100644 src/main/webapp/09-UserManagement.xhtml
create mode 100644 src/main/webapp/10-CompositeServices.xhtml
create mode 100644 src/main/webapp/404-attendanceError.xhtml
rename src/main/webapp/{loginError.xhtml => 404-loginError.xhtml} (100%)
delete mode 100644 src/main/webapp/UserCreated.xhtml
delete mode 100644 src/main/webapp/attendanceError.xhtml
delete mode 100644 src/main/webapp/attendanceGenerate.xhtml
delete mode 100644 src/main/webapp/attendanceNOK.xhtml
delete mode 100644 src/main/webapp/dropdown.xhtml
delete mode 100644 src/main/webapp/helloworld.xhtml
diff --git a/project-diagrams b/project-diagrams
deleted file mode 100644
index 4c85eb3..0000000
--- a/project-diagrams
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/project-diagrams.drawio b/project-diagrams.drawio
index 98f894e..abac217 100644
--- a/project-diagrams.drawio
+++ b/project-diagrams.drawio
@@ -1,71 +1,62 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
-
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
+
-
+
-
-
+
+
@@ -73,14 +64,289 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -88,13 +354,13 @@
-
+
-
+
@@ -117,9 +383,6 @@
-
-
-
@@ -129,14 +392,23 @@
+
+
+
-
+
+
+
+
+
+
+
@@ -180,93 +452,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/webapp/login.xhtml b/src/main/webapp/01-login.xhtml
similarity index 100%
rename from src/main/webapp/login.xhtml
rename to src/main/webapp/01-login.xhtml
diff --git a/src/main/webapp/02-studentHome.xhtml b/src/main/webapp/02-studentHome.xhtml
new file mode 100644
index 0000000..ec07e08
--- /dev/null
+++ b/src/main/webapp/02-studentHome.xhtml
@@ -0,0 +1,106 @@
+
+
+
+ Generate Attendance System
+
+
+
+
+
+
+ Generate Attendance Code
+
+
+ Attendance System Date
+ Time and Date
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Welcome
+
+ to the session
+
+ for Lecture.
+
+
+
Generate a code to register attendance for this session.
+ Remember each student in the class has a time frame for 1 minute.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/attendanceOK.xhtml b/src/main/webapp/03-attendanceOK.xhtml
similarity index 100%
rename from src/main/webapp/attendanceOK.xhtml
rename to src/main/webapp/03-attendanceOK.xhtml
diff --git a/src/main/webapp/attendanceRegister.xhtml b/src/main/webapp/04-lecturerHome.xhtml
similarity index 100%
rename from src/main/webapp/attendanceRegister.xhtml
rename to src/main/webapp/04-lecturerHome.xhtml
diff --git a/src/main/webapp/main.xhtml b/src/main/webapp/05-universityStaff.xhtml
similarity index 100%
rename from src/main/webapp/main.xhtml
rename to src/main/webapp/05-universityStaff.xhtml
diff --git a/src/main/webapp/sign.xhtml b/src/main/webapp/06-Reports.xhtml
similarity index 100%
rename from src/main/webapp/sign.xhtml
rename to src/main/webapp/06-Reports.xhtml
diff --git a/src/main/webapp/test2.xhtml b/src/main/webapp/07-StudentManagement.xhtml
similarity index 100%
rename from src/main/webapp/test2.xhtml
rename to src/main/webapp/07-StudentManagement.xhtml
diff --git a/src/main/webapp/testComponent.xhtml b/src/main/webapp/08-ClassManagement.xhtml
similarity index 100%
rename from src/main/webapp/testComponent.xhtml
rename to src/main/webapp/08-ClassManagement.xhtml
diff --git a/src/main/webapp/09-UserManagement.xhtml b/src/main/webapp/09-UserManagement.xhtml
new file mode 100644
index 0000000..953aaf8
--- /dev/null
+++ b/src/main/webapp/09-UserManagement.xhtml
@@ -0,0 +1,47 @@
+
+
+
+ Main Menu Attendance System
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/10-CompositeServices.xhtml b/src/main/webapp/10-CompositeServices.xhtml
new file mode 100644
index 0000000..5b5862c
--- /dev/null
+++ b/src/main/webapp/10-CompositeServices.xhtml
@@ -0,0 +1,47 @@
+
+
+
+ Composite Services Integration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/404-attendanceError.xhtml b/src/main/webapp/404-attendanceError.xhtml
new file mode 100644
index 0000000..b59f635
--- /dev/null
+++ b/src/main/webapp/404-attendanceError.xhtml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ Error registering attendance
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Se ha presentado un Error al publicar el aviso. Contacte a soporte
+ IT.
+
+
+
+
+
+ Suba el archivo en formato xlsx de los horarios de los abogados
+ para las distintas semanas.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/loginError.xhtml b/src/main/webapp/404-loginError.xhtml
similarity index 100%
rename from src/main/webapp/loginError.xhtml
rename to src/main/webapp/404-loginError.xhtml
diff --git a/src/main/webapp/UserCreated.xhtml b/src/main/webapp/UserCreated.xhtml
deleted file mode 100644
index 9f4bea4..0000000
--- a/src/main/webapp/UserCreated.xhtml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
- Main Menu Attendance System
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
index 7570a92..7b5a5ad 100644
--- a/src/main/webapp/WEB-INF/web.xml
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -1,9 +1,9 @@
-
+
-
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+ version="3.1">
+
AttendanceWebApp
login.xhtml
@@ -15,11 +15,11 @@
1
-
+
Faces Servlet
*.xhtml
-
+
State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2
javax.faces.STATE_SAVING_METHOD
client
@@ -30,5 +30,5 @@
com.sun.faces.config.ConfigureListener
-
+
\ No newline at end of file
diff --git a/src/main/webapp/attendanceError.xhtml b/src/main/webapp/attendanceError.xhtml
deleted file mode 100644
index c4c8ddb..0000000
--- a/src/main/webapp/attendanceError.xhtml
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
- Error registering attendance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Se
- ha presentado un Error al publicar el aviso. Contacte a soporte IT.
-
-
-
-
Suba el archivo en formato xlsx de los horarios de los
- abogados para las distintas semanas.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/webapp/attendanceGenerate.xhtml b/src/main/webapp/attendanceGenerate.xhtml
deleted file mode 100644
index 5250a45..0000000
--- a/src/main/webapp/attendanceGenerate.xhtml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- Generate Attendance System
-
-
-
-
-
-
-
-
-
- Generate Attendance Code
-
-
- Attendance System Date
- Time and Date
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Welcome
-
- to the session
-
- for Lecture.
-
-
-
Generate a code to register attendance for this session.
- Remember each student in the class has a time frame for 1 minute.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/webapp/attendanceNOK.xhtml b/src/main/webapp/attendanceNOK.xhtml
deleted file mode 100644
index 95d0311..0000000
--- a/src/main/webapp/attendanceNOK.xhtml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
- Class Attendance error
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/webapp/dropdown.xhtml b/src/main/webapp/dropdown.xhtml
deleted file mode 100644
index 43711d9..0000000
--- a/src/main/webapp/dropdown.xhtml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-Insert title here
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/webapp/helloworld.xhtml b/src/main/webapp/helloworld.xhtml
deleted file mode 100644
index ea2dd4c..0000000
--- a/src/main/webapp/helloworld.xhtml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
- Hello World
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
From 971aea8c28ad046a0d2c85df94cdc92164cdda4c Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Mon, 25 Sep 2023 12:17:11 +1300
Subject: [PATCH 10/32] gradle automation setup
documented primefaces custom repo setting
---
.gitignore | 1 +
README.md | 5 +++++
build.gradle.kts | 57 +++++++++++++++++++++++++++++++++---------------
3 files changed, 45 insertions(+), 18 deletions(-)
diff --git a/.gitignore b/.gitignore
index 7b16d59..23491a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
# Gradle
+.gradle/
**/build/
!src/**/build/
diff --git a/README.md b/README.md
index 40d722e..8e7bd57 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,11 @@
Attendance WebApp is a proof of concept to improve the way attendance is managed at AUT university.
The application uses maven, J2EE, primefaces, gson.
+```kotlin
+ maven {
+ url = uri("https://repository.primefaces.org")
+ }
+```
The idea is that you have a short timeframe to submit a random generated code by the lecturer so that attendance can be registered in the system.
The application is a proof of concept for Service orientation and Service interoperability in the cloud
diff --git a/build.gradle.kts b/build.gradle.kts
index 21b81ae..785e624 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -2,25 +2,21 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
/*
- * This file was generated by the Gradle 'init' task.
- *
- * This project uses @Incubating APIs which are subject to change.
+ * This file was generated by the Gradle 'init' task
+ * This project uses @Incubating APIs which are subject to change
*/
plugins {
java
- id ("com.adarshr.test-logger") version "3.0.0"
+ // id ("com.adarshr.test-logger") version "3.0.0"
// https://docs.gradle.org/7.3/dsl/org.gradle.api.tasks.bundling.War.html
war
+ //wsdl
+ id("org.apache.cxf.cxf") version "1.0.0"
}
repositories {
mavenCentral()
- mavenLocal()
- maven {
- url = uri("https://repository.primefaces.org")
- }
- // maven { // url = uri("https://repo.maven.apache.org/maven2/") // }
}
dependencies {
@@ -35,9 +31,15 @@ dependencies {
implementation("org.apache.httpcomponents:httpclient:4.5.3")
implementation("org.glassfish.jersey.core:jersey-common:2.22.2")
implementation("javax.servlet:javax.servlet-api:3.1.0")
- testImplementation("org.junit.jupiter:junit-jupiter-api:5.3.1")
- testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.3.1")
+ // https://mvnrepository.com/artifact/com.google.zxing/javase
+ implementation("com.google.zxing:javase:3.5.1")
+ // https://mvnrepository.com/artifact/com.google.zxing/core
+ implementation("com.google.zxing:core:3.5.1")
+ testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
+ testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.7.0")
testImplementation("io.jsonwebtoken:jjwt:0.7.0")
+ implementation("org.apache.cxf:cxf-rt-frontend-jaxws:3.4.5")
+
}
group = "soa.nz.aut"
@@ -57,21 +59,40 @@ tasks.war {
tasks {
test {
+ reports {
+ html.isEnabled = true
+ junitXml.isEnabled = true
+ }
useJUnitPlatform()
testLogging.events = setOf(TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED)
}
}
-// task{
-// testlogger{
-// setTheme("mocha")
-// showExceptions=true
-// showStackTraces=true
-// }
-// }
+tasks.register("singleTest") {
+ group = "Verification"
+ description = "Runs a test to create a local QR code"
+ filter {
+ includeTestsMatching("utilities.TestQRFunctions.createQRCodeLocally")
+ }
+}
+// task{ utilities
+// testlogger{
+// setTheme("mocha")
+// showExceptions=true
+// showStackTraces=true
+// }
+// }
// afterEvaluate {
// tasks.getByName("run") {
// dependsOn("appRun")
// }
// }
+cxf {
+ wsdl2java {
+ // wsdl info about countries
+ wsdl = "http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL"
+ packageName = "org.example.countryinfo"
+ outputDir = file("src/main/java")
+ }
+}
\ No newline at end of file
From 8023b6696f8a9e096ea9f3036f3453712399eff5 Mon Sep 17 00:00:00 2001
From: aleonrangel
Date: Mon, 25 Sep 2023 12:21:28 +1300
Subject: [PATCH 11/32] preparing test files
new testing structure based on pluralsight courses
---
.../login/TestAuthenticationResult.java | 72 ++++++++
src/test/java/attendance/login/TestLogin.java | 31 ++++
.../student/StudentAuthenticationResult.java | 72 ++++++++
.../student/StudentAuthorization.java | 31 ++++
.../java/attendance/student/TestStudent.java | 25 +++
.../restclient/JerseyClient.java | 41 +++++
.../restclient/JerseyClientPost.java | 33 ++++
.../restclient/JerseyGet.java | 37 ++++
.../restclient/JerseyJsonResponse.java | 36 ++++
.../restclient/JerseyJsonSimpler.java | 28 +++
.../restclient/JerseyPost.java | 36 ++++
.../restclient/JerseyPostHeader.java | 24 +++
.../restclient/JerseyTest.java | 36 ++++
.../restclient/NetClientPost.java | 56 ++++++
.../restclient/TestRestClient.java | 38 ++++
.../wsclient/GeoIP.java | 172 ++++++++++++++++++
.../wsclient/GeoIPService.java | 98 ++++++++++
.../wsclient/GeoIPServiceSoap.java | 55 ++++++
.../wsclient/GetGeoIP.java | 70 +++++++
.../wsclient/GetGeoIPContext.java | 37 ++++
.../wsclient/GetGeoIPContextResponse.java | 69 +++++++
.../wsclient/GetGeoIPResponse.java | 69 +++++++
.../wsclient/ObjectFactory.java | 90 +++++++++
.../wsclient/package-info.java | 6 +
.../wsdlclient/MockCountryInfoService.java | 16 ++
.../wsdlclient/ServiceInvokationTest.java | 28 +++
.../PostAuthenticationToken.java | 85 +++++++++
src/test/java/json/ConversionJSON2Object.java | 30 +++
src/test/java/json/ConversionJson2Map.java | 39 ++++
src/test/java/json/JSON2Object.java | 24 +++
src/test/java/json/Json2Map.java | 39 ++++
src/test/java/json/TestJSONResponse.java | 62 +++++++
.../java/utilities/TestCodeGeneration.java | 15 ++
src/test/java/utilities/TestQRFunctions.java | 13 ++
34 files changed, 1613 insertions(+)
create mode 100644 src/test/java/attendance/login/TestAuthenticationResult.java
create mode 100644 src/test/java/attendance/login/TestLogin.java
create mode 100644 src/test/java/attendance/student/StudentAuthenticationResult.java
create mode 100644 src/test/java/attendance/student/StudentAuthorization.java
create mode 100644 src/test/java/attendance/student/TestStudent.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyClient.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyClientPost.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyGet.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyJsonResponse.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyJsonSimpler.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyPost.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyPostHeader.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/JerseyTest.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/NetClientPost.java
create mode 100644 src/test/java/external/composite-app-mock-services/restclient/TestRestClient.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GeoIP.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GeoIPService.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GeoIPServiceSoap.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GetGeoIP.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContext.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContextResponse.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPResponse.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/ObjectFactory.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsclient/package-info.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsdlclient/MockCountryInfoService.java
create mode 100644 src/test/java/external/composite-app-mock-services/wsdlclient/ServiceInvokationTest.java
create mode 100644 src/test/java/external/tokenauthentication/PostAuthenticationToken.java
create mode 100644 src/test/java/json/ConversionJSON2Object.java
create mode 100644 src/test/java/json/ConversionJson2Map.java
create mode 100644 src/test/java/json/JSON2Object.java
create mode 100644 src/test/java/json/Json2Map.java
create mode 100644 src/test/java/json/TestJSONResponse.java
create mode 100644 src/test/java/utilities/TestCodeGeneration.java
create mode 100644 src/test/java/utilities/TestQRFunctions.java
diff --git a/src/test/java/attendance/login/TestAuthenticationResult.java b/src/test/java/attendance/login/TestAuthenticationResult.java
new file mode 100644
index 0000000..85d629e
--- /dev/null
+++ b/src/test/java/attendance/login/TestAuthenticationResult.java
@@ -0,0 +1,72 @@
+package attendance.login;
+
+import com.google.gson.annotations.SerializedName;
+
+public class TestAuthenticationResult {
+
+ public TestAuthenticationResult(String accessToken, Integer expiresIn, String tokenType, String refreshToken,
+ String idToken) {
+ this.accessToken = accessToken;
+ this.expiresIn = expiresIn;
+ this.tokenType = tokenType;
+ this.refreshToken = refreshToken;
+ this.idToken = idToken;
+ }
+
+ @SerializedName("AccessToken")
+ private String accessToken;
+
+ @SerializedName("ExpiresIn")
+ private Integer expiresIn;
+
+ @SerializedName("TokenType")
+ private String tokenType;
+
+ @SerializedName("RefreshToken")
+ private String refreshToken;
+
+ @SerializedName("IdToken")
+ private String idToken;
+
+ // Setters and getters
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ public Integer getExpiresIn() {
+ return expiresIn;
+ }
+
+ public void setExpiresIn(Integer expiresIn) {
+ this.expiresIn = expiresIn;
+ }
+
+ public String getTokenType() {
+ return tokenType;
+ }
+
+ public void setTokenType(String tokenType) {
+ this.tokenType = tokenType;
+ }
+
+ public String getRefreshToken() {
+ return refreshToken;
+ }
+
+ public void setRefreshToken(String refreshToken) {
+ this.refreshToken = refreshToken;
+ }
+
+ public String getIdToken() {
+ return idToken;
+ }
+
+ public void setIdToken(String idToken) {
+ this.idToken = idToken;
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/attendance/login/TestLogin.java b/src/test/java/attendance/login/TestLogin.java
new file mode 100644
index 0000000..3eed44e
--- /dev/null
+++ b/src/test/java/attendance/login/TestLogin.java
@@ -0,0 +1,31 @@
+package attendance.login;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
+
+import bean.UserBean;
+
+public class TestLogin {
+
+ @Test
+ public void GetToken() {
+ // fail("Not yet implemented");
+ }
+
+ @Test
+ public void loginGeneralUser() {
+ UserBean user = new UserBean();
+ user.setId("10295765");
+ user.setPassword("Value!12");
+ // System.out.println("assert result"+user.login());
+ assertTrue(user.login() == "main");
+ }
+
+ public void loginGeneralUserNOK() {
+ }
+
+ public void loginLecturer() {
+ }
+
+}
\ No newline at end of file
diff --git a/src/test/java/attendance/student/StudentAuthenticationResult.java b/src/test/java/attendance/student/StudentAuthenticationResult.java
new file mode 100644
index 0000000..2a29d77
--- /dev/null
+++ b/src/test/java/attendance/student/StudentAuthenticationResult.java
@@ -0,0 +1,72 @@
+package attendance.gson;
+
+import com.google.gson.annotations.SerializedName;
+
+public class StudentAuthenticationResult {
+
+ public StudentAuthenticationResult(String accessToken, Integer expiresIn, String tokenType, String refreshToken,
+ String idToken) {
+ this.accessToken = accessToken;
+ this.expiresIn = expiresIn;
+ this.tokenType = tokenType;
+ this.refreshToken = refreshToken;
+ this.idToken = idToken;
+ }
+
+ @SerializedName("AccessToken")
+ private String accessToken;
+
+ @SerializedName("ExpiresIn")
+ private Integer expiresIn;
+
+ @SerializedName("TokenType")
+ private String tokenType;
+
+ @SerializedName("RefreshToken")
+ private String refreshToken;
+
+ @SerializedName("IdToken")
+ private String idToken;
+
+ // Setters and getters
+
+ public String getAccessToken() {
+ return accessToken;
+ }
+
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+
+ public Integer getExpiresIn() {
+ return expiresIn;
+ }
+
+ public void setExpiresIn(Integer expiresIn) {
+ this.expiresIn = expiresIn;
+ }
+
+ public String getTokenType() {
+ return tokenType;
+ }
+
+ public void setTokenType(String tokenType) {
+ this.tokenType = tokenType;
+ }
+
+ public String getRefreshToken() {
+ return refreshToken;
+ }
+
+ public void setRefreshToken(String refreshToken) {
+ this.refreshToken = refreshToken;
+ }
+
+ public String getIdToken() {
+ return idToken;
+ }
+
+ public void setIdToken(String idToken) {
+ this.idToken = idToken;
+ }
+}
diff --git a/src/test/java/attendance/student/StudentAuthorization.java b/src/test/java/attendance/student/StudentAuthorization.java
new file mode 100644
index 0000000..d4df42b
--- /dev/null
+++ b/src/test/java/attendance/student/StudentAuthorization.java
@@ -0,0 +1,31 @@
+package test.student;
+
+import com.google.gson.annotations.SerializedName;
+
+import entity.ChallengeParameters;
+
+public class StudentAuthorization {
+
+ // names have to be the same from JSON to Java Object so that it works fine.
+
+ private ChallengeParameters challengeParameters;
+ // @SerializedName("AuthenticationResult")
+ // @Expose
+ private StudentAuthenticationResult authenticationResult;
+
+ public ChallengeParameters getChallengeParameters() {
+ return challengeParameters;
+ }
+
+ public void setChallengeParameters(ChallengeParameters challengeParameters) {
+ this.challengeParameters = challengeParameters;
+ }
+
+ public StudentAuthenticationResult getAuthenticationResult() {
+ return authenticationResult;
+ }
+
+ public void setAuthenticationResult(StudentAuthenticationResult authenticationResult) {
+ this.authenticationResult = authenticationResult;
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/attendance/student/TestStudent.java b/src/test/java/attendance/student/TestStudent.java
new file mode 100644
index 0000000..be1a249
--- /dev/null
+++ b/src/test/java/attendance/student/TestStudent.java
@@ -0,0 +1,25 @@
+package attendance.student;
+
+import javax.faces.bean.ManagedBean;
+
+@ManagedBean
+public class TestStudent {
+
+ private String name;
+
+ public String sayHello() {
+ if (name != null && !name.trim().equals("")) {
+ return "Hello, " + name + "!";
+ } else {
+ return null;
+ }
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyClient.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyClient.java
new file mode 100644
index 0000000..27af2ad
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyClient.java
@@ -0,0 +1,41 @@
+package external.services.restclient;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.http.client.ClientProtocolException;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.ClientConfig;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+
+public class JerseyClient {
+
+ /**
+ * @param args
+ * @throws ClientProtocolException
+ * @throws IOException
+ */
+
+ public void obtainJSONResponse() throws ClientProtocolException, IOException {
+
+ // Invoke REST service with GET Method
+ ClientConfig config = new DefaultClientConfig();
+ Client client = Client.create(config);
+
+ WebResource service = client
+ .resource(UriBuilder.fromUri("https://ctpoixww04.execute-api.us-east-1.amazonaws.com").build());
+
+ // getting JSON data
+ System.out.println("With JSON" + service.path("dev").path("session").accept(MediaType.APPLICATION_JSON).header(
+ "Authorization",
+ "eyJraWQiOiJKQWJRaHNlTTVldFRBMk1vMlpoNGs5Mlp2ZmFHaU5zWWtVQlFNbG1cL1Mybz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2MWI5ZTI4NC1kMzVhLTQ0M2YtOTlhNy04MGY0OWE4YTI4NmQiLCJhdWQiOiIxZTh0ZWZtbGNsMmgyOTB2bmg5cmNlZm52ciIsImNvZ25pdG86Z3JvdXBzIjpbImFkbWluaXN0cmF0b3IiXSwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTUwNTAyMTU0OSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfMEhkMUtvTTVhIiwiY29nbml0bzp1c2VybmFtZSI6IjEwMjk1NzY1IiwiZXhwIjoxNTA1MDI1MTQ5LCJpYXQiOjE1MDUwMjE1NDksImVtYWlsIjoiam9uYXRoYW4udEB4dHJhLmNvLm56In0.pL9EmmsbB-pxTCXRmDmAAnfMBhLgEY39tbNf0LMhHWF_sSFTB6gYELxnfNa3ITMEEV_wwgvJ-9USb3nHh1G8JkNDxDVCS0S0q4U81GZDqA8USGzA4mklTg1qROlHQkKFipaKQia8U9oLZSIGp6HrpvtQN7wOm9S_0Z5ePXN2REgYsWKobfkLI3dHICACt0RANRBLlXNlQC1F8Hj7dl7UbeQkCZqgj_J_GcxHHLHBRRERO4Koz09gYBhpVrWZZlbUJpwAk3OVCesj7Wz73xjpE2ckm9x6SLkzxC8W5FLvyH5rbiD7Dif9xIVB6jV1pz9GIwMGqzcSWT0LIujw90hoNg")
+ .get(String.class));
+ }
+
+ public void obtainXMLResponse() throws ClientProtocolException, IOException {
+ // getting XML data
+ // System.out.println("with
+ // XML"+service.path("dev").path("session").accept(MediaType.APPLICATION_XML).get(String.class));
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyClientPost.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyClientPost.java
new file mode 100644
index 0000000..dfcb8d2
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyClientPost.java
@@ -0,0 +1,33 @@
+package external.services.restclient;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+
+public class JerseyClientPost {
+
+ public static void main(String[] args) {
+
+ try {
+ Client client = Client.create();
+ WebResource webResource = client
+ .resource("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
+ String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
+ ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
+
+ if (response.getStatus() != 201) {
+ throw new RuntimeException("Failed : HTTP error code : "
+ + response.getStatus());
+ }
+
+ System.out.println("Output from Server .... \n");
+ String output = response.getEntity(String.class);
+ System.out.println(output);
+
+ } catch (Exception e) {
+
+ e.printStackTrace();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyGet.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyGet.java
new file mode 100644
index 0000000..7306244
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyGet.java
@@ -0,0 +1,37 @@
+package external.services.restclient;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.http.client.ClientProtocolException;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.ClientConfig;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+
+public class JerseyGet {
+
+ /**
+ * @param args
+ * @throws ClientProtocolException
+ * @throws IOException
+ */
+ public static void main(String[] args) throws ClientProtocolException, IOException {
+
+ ClientConfig config = new DefaultClientConfig();
+ Client client = Client.create(config);
+
+ WebResource service = client
+ .resource(UriBuilder.fromUri("https://ctpoixww04.execute-api.us-east-1.amazonaws.com").build());
+
+ // getting JSON data
+ System.out.println("With JSON" + service.path("dev").path("session").accept(MediaType.APPLICATION_JSON).header(
+ "Authorization",
+ "eyJraWQiOiJKQWJRaHNlTTVldFRBMk1vMlpoNGs5Mlp2ZmFHaU5zWWtVQlFNbG1cL1Mybz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2MWI5ZTI4NC1kMzVhLTQ0M2YtOTlhNy04MGY0OWE4YTI4NmQiLCJhdWQiOiIxZTh0ZWZtbGNsMmgyOTB2bmg5cmNlZm52ciIsImNvZ25pdG86Z3JvdXBzIjpbImFkbWluaXN0cmF0b3IiXSwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTUwNTAyMTU0OSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfMEhkMUtvTTVhIiwiY29nbml0bzp1c2VybmFtZSI6IjEwMjk1NzY1IiwiZXhwIjoxNTA1MDI1MTQ5LCJpYXQiOjE1MDUwMjE1NDksImVtYWlsIjoiam9uYXRoYW4udEB4dHJhLmNvLm56In0.pL9EmmsbB-pxTCXRmDmAAnfMBhLgEY39tbNf0LMhHWF_sSFTB6gYELxnfNa3ITMEEV_wwgvJ-9USb3nHh1G8JkNDxDVCS0S0q4U81GZDqA8USGzA4mklTg1qROlHQkKFipaKQia8U9oLZSIGp6HrpvtQN7wOm9S_0Z5ePXN2REgYsWKobfkLI3dHICACt0RANRBLlXNlQC1F8Hj7dl7UbeQkCZqgj_J_GcxHHLHBRRERO4Koz09gYBhpVrWZZlbUJpwAk3OVCesj7Wz73xjpE2ckm9x6SLkzxC8W5FLvyH5rbiD7Dif9xIVB6jV1pz9GIwMGqzcSWT0LIujw90hoNg")
+ .get(String.class));
+
+ // getting XML data
+ // System.out.println("with
+ // XML"+service.path("dev").path("session").accept(MediaType.APPLICATION_XML).get(String.class));
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyJsonResponse.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyJsonResponse.java
new file mode 100644
index 0000000..d4e8bb9
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyJsonResponse.java
@@ -0,0 +1,36 @@
+package external.services.restclient;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+
+public class JerseyJsonResponse {
+
+ public static void main(String[] args) {
+ try {
+ String baseuri = "https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login/";
+ Client client = Client.create();
+
+ WebResource webResource = client.resource(baseuri);
+
+ String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
+
+ // POST method
+ ClientResponse response = webResource.accept("application/json").type("type:application/json")
+ .post(ClientResponse.class, input);
+
+ // check response status code
+ if (response.getStatus() != 200) {
+ throw new RuntimeException("Failed : HTTP error code : " + response.getStatus());
+ }
+
+ // display response
+ String output = response.getEntity(String.class);
+ System.out.println("Output from Server .... ");
+ System.out.println(output + "\n");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ } // main()
+}
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyJsonSimpler.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyJsonSimpler.java
new file mode 100644
index 0000000..ec56267
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyJsonSimpler.java
@@ -0,0 +1,28 @@
+package external.services.restclient;
+
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.representation.Form;
+
+public class JerseyJsonSimpler {
+
+ public static void main(String[] args) {
+
+ try {
+ Client client = (Client) ClientBuilder.newClient();
+ WebTarget target = ((javax.ws.rs.client.Client) client).target("http://localhost:9998").path("resource");
+
+ Form form = new Form();
+ form.add("id", "10295765");
+ form.add("password", "Value!12");
+ // ClientResponse response =
+ // WebResource.class.type(MediaType.TEXT_PLAIN).post(ClientResponse.class,
+ // form);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyPost.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyPost.java
new file mode 100644
index 0000000..1cee7b6
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyPost.java
@@ -0,0 +1,36 @@
+package external.services.restclient;
+
+import java.io.IOException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.UriBuilder;
+import org.apache.http.client.ClientProtocolException;
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.client.config.ClientConfig;
+import com.sun.jersey.api.client.config.DefaultClientConfig;
+import com.sun.jersey.core.util.MultivaluedMapImpl;
+
+public class JerseyPost {
+
+ public static void main(String[] args) throws ClientProtocolException, IOException {
+
+ ClientConfig config = new DefaultClientConfig();
+
+ Client client = Client.create(config);
+
+ WebResource webResource = client
+ .resource(UriBuilder.fromUri("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/").build());
+
+ MultivaluedMap formData = new MultivaluedMapImpl();
+
+ formData.add("id", "10295765");
+ formData.add("password", "Value!12");
+
+ ClientResponse response = webResource.path("dev").path("login").type(MediaType.APPLICATION_FORM_URLENCODED)
+ .post(ClientResponse.class, formData);
+
+ System.out.println("Response " + response.getEntity(String.class));
+ }
+}
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyPostHeader.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyPostHeader.java
new file mode 100644
index 0000000..e9c68c5
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyPostHeader.java
@@ -0,0 +1,24 @@
+package external.services.restclient;
+
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.MediaType;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+import com.sun.jersey.api.representation.Form;
+
+public class JerseyPostHeader {
+
+ Client client = (Client) ClientBuilder.newClient();
+ WebTarget target = ((javax.ws.rs.client.Client) client).target("http://localhost:9998").path("resource");
+
+ Form form = new Form();
+ // form.param("x", "foo");
+ // form.param("y", "bar");
+
+ // String bean =
+ // target.request(MediaType.APPLICATION_JSON_TYPE).post(MediaType.APPLICATION_FORM_URLENCODED_TYPE,
+ // String.class);
+}
diff --git a/src/test/java/external/composite-app-mock-services/restclient/JerseyTest.java b/src/test/java/external/composite-app-mock-services/restclient/JerseyTest.java
new file mode 100644
index 0000000..6cee1e0
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/JerseyTest.java
@@ -0,0 +1,36 @@
+package external.services.restclient;
+
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.Response;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.WebResource;
+
+import util.AuthenticateToken;
+
+public class JerseyTest {
+
+ public static void main(String[] args) {
+ testAttendanceRegister();
+ // responseREST();
+ }
+
+ String responseREST() {
+ // Client client =(Client) ClientBuilder.newClient();
+ Client client = Client.create();
+ WebResource target = client.resource("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
+ String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
+
+ Response response = ((WebTarget) target).request("application/json").post(Entity.json(input));
+ // System.out.println(response.toString());
+
+ return response.toString();
+ }
+
+ static void testAttendanceRegister() {
+ AuthenticateToken att = new AuthenticateToken();
+ att.confirmAttendance();
+ }
+
+}
diff --git a/src/test/java/external/composite-app-mock-services/restclient/NetClientPost.java b/src/test/java/external/composite-app-mock-services/restclient/NetClientPost.java
new file mode 100644
index 0000000..1e71581
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/NetClientPost.java
@@ -0,0 +1,56 @@
+package external.services.restclient;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+public class NetClientPost {
+
+ // http://localhost:8080/RESTfulExample/json/product/post
+ public static void main(String[] args) {
+
+ try {
+ URL url = new URL("https://fahze41owc.execute-api.us-east-1.amazonaws.com/dev/user");
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/json");
+
+ String input = "{\r\n" +
+ " \"id\": \"102030\",\r\n" +
+ " \"firstName\": \"Julito\",\r\n" +
+ " \"lastName\": \"Schwartzenegger\",\r\n" +
+ " \"type\": \"administrator\"\r\n" +
+ "}";
+
+ OutputStream os = conn.getOutputStream();
+ os.write(input.getBytes());
+ os.flush();
+
+ if (conn.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
+ throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
+ }
+
+ BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
+
+ String output;
+ System.out.println("Output from Server .... \n");
+ while ((output = br.readLine()) != null) {
+ System.out.println(output);
+ }
+
+ conn.disconnect();
+
+ } catch (MalformedURLException e) {
+
+ e.printStackTrace();
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/restclient/TestRestClient.java b/src/test/java/external/composite-app-mock-services/restclient/TestRestClient.java
new file mode 100644
index 0000000..8b4f929
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/restclient/TestRestClient.java
@@ -0,0 +1,38 @@
+package external.services.restclient;
+
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientResponse;
+import com.sun.jersey.api.client.WebResource;
+
+public class TestRestClient {
+ string AWS_URL = "https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login";
+
+ public void checkServiceAvailability() {
+
+ }
+
+ public void testAWSConnectAPI() {
+
+ try {
+
+ Client client = Client.create();
+ WebResource webResource = client.resource(+AWS_URL);
+ String input = "{\"id\":\"10295765\",\"password\":\"TestPassword!12\"}";
+ ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
+
+ if (response.getStatus() != 201) {
+ throw new RuntimeException("Failed : HTTP error code : "
+ + response.getStatus());
+ }
+
+ System.out.println("Output from Server .... \n");
+ String output = response.getEntity(String.class);
+ System.out.println(output);
+
+ } catch (Exception e) {
+
+ e.printStackTrace();
+
+ }
+ }
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GeoIP.java b/src/test/java/external/composite-app-mock-services/wsclient/GeoIP.java
new file mode 100644
index 0000000..8a58a95
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GeoIP.java
@@ -0,0 +1,172 @@
+/**
+ * Class GeoIP imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * Java class for GeoIP complex type.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ * <complexType name="GeoIP">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="ReturnCode" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * <element name="IP" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="ReturnCodeDetails" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="CountryName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="CountryCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "GeoIP", propOrder = {
+ "returnCode",
+ "ip",
+ "returnCodeDetails",
+ "countryName",
+ "countryCode"
+})
+public class GeoIP {
+
+ @XmlElement(name = "ReturnCode")
+ protected int returnCode;
+ @XmlElement(name = "IP")
+ protected String ip;
+ @XmlElement(name = "ReturnCodeDetails")
+ protected String returnCodeDetails;
+ @XmlElement(name = "CountryName")
+ protected String countryName;
+ @XmlElement(name = "CountryCode")
+ protected String countryCode;
+
+ /**
+ * Gets the value of the returnCode property.
+ *
+ */
+ public int getReturnCode() {
+ return returnCode;
+ }
+
+ /**
+ * Sets the value of the returnCode property.
+ *
+ */
+ public void setReturnCode(int value) {
+ this.returnCode = value;
+ }
+
+ /**
+ * Gets the value of the ip property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIP() {
+ return ip;
+ }
+
+ /**
+ * Sets the value of the ip property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIP(String value) {
+ this.ip = value;
+ }
+
+ /**
+ * Gets the value of the returnCodeDetails property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getReturnCodeDetails() {
+ return returnCodeDetails;
+ }
+
+ /**
+ * Sets the value of the returnCodeDetails property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setReturnCodeDetails(String value) {
+ this.returnCodeDetails = value;
+ }
+
+ /**
+ * Gets the value of the countryName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCountryName() {
+ return countryName;
+ }
+
+ /**
+ * Sets the value of the countryName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCountryName(String value) {
+ this.countryName = value;
+ }
+
+ /**
+ * Gets the value of the countryCode property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCountryCode() {
+ return countryCode;
+ }
+
+ /**
+ * Sets the value of the countryCode property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCountryCode(String value) {
+ this.countryCode = value;
+ }
+
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GeoIPService.java b/src/test/java/external/composite-app-mock-services/wsclient/GeoIPService.java
new file mode 100644
index 0000000..718e2c7
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GeoIPService.java
@@ -0,0 +1,98 @@
+/**
+ * Class GeoIPService imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2.9-b130926.1035
+ * Generated source version: 2.2
+ *
+ */
+@WebServiceClient(name = "GeoIPService", targetNamespace = "http://www.webservicex.net/", wsdlLocation = "http://www.webservicex.net/geoipservice.asmx?WSDL")
+public class GeoIPService
+ extends Service {
+
+ private final static URL GEOIPSERVICE_WSDL_LOCATION;
+ private final static WebServiceException GEOIPSERVICE_EXCEPTION;
+ private final static QName GEOIPSERVICE_QNAME = new QName("http://www.webservicex.net/", "GeoIPService");
+
+ static {
+ URL url = null;
+ WebServiceException e = null;
+ try {
+ url = new URL("http://www.webservicex.net/geoipservice.asmx?WSDL");
+ } catch (MalformedURLException ex) {
+ e = new WebServiceException(ex);
+ }
+ GEOIPSERVICE_WSDL_LOCATION = url;
+ GEOIPSERVICE_EXCEPTION = e;
+ }
+
+ public GeoIPService() {
+ super(__getWsdlLocation(), GEOIPSERVICE_QNAME);
+ }
+
+ public GeoIPService(WebServiceFeature... features) {
+ super(__getWsdlLocation(), GEOIPSERVICE_QNAME, features);
+ }
+
+ public GeoIPService(URL wsdlLocation) {
+ super(wsdlLocation, GEOIPSERVICE_QNAME);
+ }
+
+ public GeoIPService(URL wsdlLocation, WebServiceFeature... features) {
+ super(wsdlLocation, GEOIPSERVICE_QNAME, features);
+ }
+
+ public GeoIPService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public GeoIPService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
+ super(wsdlLocation, serviceName, features);
+ }
+
+ /**
+ * @return
+ * returns GeoIPServiceSoap
+ */
+ @WebEndpoint(name = "GeoIPServiceSoap")
+ public GeoIPServiceSoap getGeoIPServiceSoap() {
+ return super.getPort(new QName("http://www.webservicex.net/", "GeoIPServiceSoap"), GeoIPServiceSoap.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure
+ * on the proxy. Supported features not in the
+ * features
parameter will have their default
+ * values.
+ * @return
+ * returns GeoIPServiceSoap
+ */
+ @WebEndpoint(name = "GeoIPServiceSoap")
+ public GeoIPServiceSoap getGeoIPServiceSoap(WebServiceFeature... features) {
+ return super.getPort(new QName("http://www.webservicex.net/", "GeoIPServiceSoap"), GeoIPServiceSoap.class,
+ features);
+ }
+
+ private static URL __getWsdlLocation() {
+ if (GEOIPSERVICE_EXCEPTION != null) {
+ throw GEOIPSERVICE_EXCEPTION;
+ }
+ return GEOIPSERVICE_WSDL_LOCATION;
+ }
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GeoIPServiceSoap.java b/src/test/java/external/composite-app-mock-services/wsclient/GeoIPServiceSoap.java
new file mode 100644
index 0000000..e51bfa8
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GeoIPServiceSoap.java
@@ -0,0 +1,55 @@
+/**
+ * Class GeoIPServiceSoap imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2.9-b130926.1035
+ * Generated source version: 2.2
+ *
+ */
+@WebService(name = "GeoIPServiceSoap", targetNamespace = "http://www.webservicex.net/")
+@XmlSeeAlso({
+ ObjectFactory.class
+})
+public interface GeoIPServiceSoap {
+
+ /**
+ * GeoIPService - GetGeoIP enables you to easily look up countries by IP
+ * addresses
+ *
+ * @param ipAddress
+ * @return
+ * returns wsclient.GeoIP
+ */
+ @WebMethod(operationName = "GetGeoIP", action = "http://www.webservicex.net/GetGeoIP")
+ @WebResult(name = "GetGeoIPResult", targetNamespace = "http://www.webservicex.net/")
+ @RequestWrapper(localName = "GetGeoIP", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIP")
+ @ResponseWrapper(localName = "GetGeoIPResponse", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIPResponse")
+ public GeoIP getGeoIP(
+ @WebParam(name = "IPAddress", targetNamespace = "http://www.webservicex.net/") String ipAddress);
+
+ /**
+ * GeoIPService - GetGeoIPContext enables you to easily look up countries by
+ * Context
+ *
+ * @return
+ * returns wsclient.GeoIP
+ */
+ @WebMethod(operationName = "GetGeoIPContext", action = "http://www.webservicex.net/GetGeoIPContext")
+ @WebResult(name = "GetGeoIPContextResult", targetNamespace = "http://www.webservicex.net/")
+ @RequestWrapper(localName = "GetGeoIPContext", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIPContext")
+ @ResponseWrapper(localName = "GetGeoIPContextResponse", targetNamespace = "http://www.webservicex.net/", className = "wsclient.GetGeoIPContextResponse")
+ public GeoIP getGeoIPContext();
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIP.java b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIP.java
new file mode 100644
index 0000000..821b804
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIP.java
@@ -0,0 +1,70 @@
+/**
+ * Class GetGeoIP imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * Java class for anonymous complex type.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="IPAddress" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "ipAddress"
+})
+@XmlRootElement(name = "GetGeoIP")
+public class GetGeoIP {
+
+ @XmlElement(name = "IPAddress")
+ protected String ipAddress;
+
+ /**
+ * Gets the value of the ipAddress property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIPAddress() {
+ return ipAddress;
+ }
+
+ /**
+ * Sets the value of the ipAddress property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIPAddress(String value) {
+ this.ipAddress = value;
+ }
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContext.java b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContext.java
new file mode 100644
index 0000000..c1a2d5a
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContext.java
@@ -0,0 +1,37 @@
+/**
+ * Class GetGeoIPContext imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * Java class for anonymous complex type.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "")
+@XmlRootElement(name = "GetGeoIPContext")
+public class GetGeoIPContext {
+
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContextResponse.java b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContextResponse.java
new file mode 100644
index 0000000..7d94432
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPContextResponse.java
@@ -0,0 +1,69 @@
+/**
+ * Class getGeoIPContextResult imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * Java class for anonymous complex type.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="GetGeoIPContextResult" type="{http://www.webservicex.net/}GeoIP" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ */
+
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "getGeoIPContextResult"
+})
+@XmlRootElement(name = "GetGeoIPContextResponse")
+public class GetGeoIPContextResponse {
+
+ @XmlElement(name = "GetGeoIPContextResult")
+ protected GeoIP getGeoIPContextResult;
+
+ /**
+ * Gets the value of the getGeoIPContextResult property.
+ *
+ * @return
+ * possible object is
+ * {@link GeoIP }
+ *
+ */
+ public GeoIP getGetGeoIPContextResult() {
+ return getGeoIPContextResult;
+ }
+
+ /**
+ * Sets the value of the getGeoIPContextResult property.
+ *
+ * @param value
+ * allowed object is
+ * {@link GeoIP }
+ *
+ */
+ public void setGetGeoIPContextResult(GeoIP value) {
+ this.getGeoIPContextResult = value;
+ }
+
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPResponse.java b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPResponse.java
new file mode 100644
index 0000000..8ce29b2
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/GetGeoIPResponse.java
@@ -0,0 +1,69 @@
+/**
+ * Class getGeoIPResult imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ *
+ * Java class for anonymous complex type.
+ *
+ *
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ *
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="GetGeoIPResult" type="{http://www.webservicex.net/}GeoIP" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {
+ "getGeoIPResult"
+})
+@XmlRootElement(name = "GetGeoIPResponse")
+public class GetGeoIPResponse {
+
+ @XmlElement(name = "GetGeoIPResult")
+ protected GeoIP getGeoIPResult;
+
+ /**
+ * Gets the value of the getGeoIPResult property.
+ *
+ * @return
+ * possible object is
+ * {@link GeoIP }
+ *
+ */
+ public GeoIP getGetGeoIPResult() {
+ return getGeoIPResult;
+ }
+
+ /**
+ * Sets the value of the getGeoIPResult property.
+ *
+ * @param value
+ * allowed object is
+ * {@link GeoIP }
+ *
+ */
+ public void setGetGeoIPResult(GeoIP value) {
+ this.getGeoIPResult = value;
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/ObjectFactory.java b/src/test/java/external/composite-app-mock-services/wsclient/ObjectFactory.java
new file mode 100644
index 0000000..f94606f
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/ObjectFactory.java
@@ -0,0 +1,90 @@
+/**
+ * Class ObjectFactory imported from WSDL with java tool
+ * replicates WSDL to invoke External Web service
+ */
+
+package external.services.wsclient;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the wsclient package.
+ *
+ * An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _GeoIP_QNAME = new QName("http://www.webservicex.net/", "GeoIP");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema
+ * derived classes for package: wsclient
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link GeoIP }
+ *
+ */
+ public GeoIP createGeoIP() {
+ return new GeoIP();
+ }
+
+ /**
+ * Create an instance of {@link GetGeoIP }
+ *
+ */
+ public GetGeoIP createGetGeoIP() {
+ return new GetGeoIP();
+ }
+
+ /**
+ * Create an instance of {@link GetGeoIPResponse }
+ *
+ */
+ public GetGeoIPResponse createGetGeoIPResponse() {
+ return new GetGeoIPResponse();
+ }
+
+ /**
+ * Create an instance of {@link GetGeoIPContextResponse }
+ *
+ */
+ public GetGeoIPContextResponse createGetGeoIPContextResponse() {
+ return new GetGeoIPContextResponse();
+ }
+
+ /**
+ * Create an instance of {@link GetGeoIPContext }
+ *
+ */
+ public GetGeoIPContext createGetGeoIPContext() {
+ return new GetGeoIPContext();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link GeoIP }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://www.webservicex.net/", name = "GeoIP")
+ public JAXBElement createGeoIP(GeoIP value) {
+ return new JAXBElement(_GeoIP_QNAME, GeoIP.class, null, value);
+ }
+
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsclient/package-info.java b/src/test/java/external/composite-app-mock-services/wsclient/package-info.java
new file mode 100644
index 0000000..a7a776e
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsclient/package-info.java
@@ -0,0 +1,6 @@
+/**
+ * injects annotation for java tool to work and invoke the WSDL
+ */
+
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.webservicex.net/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package external.services.wsclient;
diff --git a/src/test/java/external/composite-app-mock-services/wsdlclient/MockCountryInfoService.java b/src/test/java/external/composite-app-mock-services/wsdlclient/MockCountryInfoService.java
new file mode 100644
index 0000000..a1f9c31
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsdlclient/MockCountryInfoService.java
@@ -0,0 +1,16 @@
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.example.countryinfo.CountryInfoService;
+
+public class MockCountryInfoService implements CountryInfoService {
+ // Implement the methods from the CountryInfoService interface here
+
+ public static void main(String[] args) {
+ MockCountryInfoService mockService = new MockCountryInfoService();
+
+ JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
+ factory.setServiceClass(CountryInfoService.class);
+ factory.setAddress("http://localhost:8080/");
+ factory.setServiceBean(mockService);
+ factory.create();
+ }
+}
diff --git a/src/test/java/external/composite-app-mock-services/wsdlclient/ServiceInvokationTest.java b/src/test/java/external/composite-app-mock-services/wsdlclient/ServiceInvokationTest.java
new file mode 100644
index 0000000..fd7800b
--- /dev/null
+++ b/src/test/java/external/composite-app-mock-services/wsdlclient/ServiceInvokationTest.java
@@ -0,0 +1,28 @@
+package external.services.wsdlclient;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import service.MainService;
+import util.AuthenticateToken;
+
+public class ServiceInvokationTest {
+
+ MainService testService = new MainService();
+ AuthenticateToken attend = new AuthenticateToken();
+
+ @Test
+ public void testWSDLSuccess() {
+
+ assertTrue(testService.invokeWSDLForIP().length() > 2);
+ // System.out.println(testService.invokeWSDLForIP());
+ }
+
+ @Test
+ public void testRestBibleSuccess() {
+ assertTrue(testService.invokeRestForBibleVerse().length() > 2);
+ // System.out.println(testService.invokeRestForBibleVerse());
+ }
+}
diff --git a/src/test/java/external/tokenauthentication/PostAuthenticationToken.java b/src/test/java/external/tokenauthentication/PostAuthenticationToken.java
new file mode 100644
index 0000000..8c93550
--- /dev/null
+++ b/src/test/java/external/tokenauthentication/PostAuthenticationToken.java
@@ -0,0 +1,85 @@
+package external.tokenauthentication;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.JsonReader;
+
+public class PostAuthenticationToken {
+
+ // authentication scheme based on tokens follow these steps, steps are numbered
+ public static void main(String[] args) {
+
+ try {
+
+ URL url = new URL("https://ctpoixww04.execute-api.us-east-1.amazonaws.com/dev/login");
+ HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+ conn.setDoOutput(true);
+ conn.setRequestMethod("POST");
+ conn.setRequestProperty("Content-Type", "application/json");
+
+ String input = "{\"id\":\"10295765\",\"password\":\"Value!12\"}";
+
+ OutputStream os = conn.getOutputStream();
+ // 1.The client sends their credentials (username and password) to the server.
+ os.write(input.getBytes());
+ os.flush();
+
+ if (conn.getResponseCode() != HttpURLConnection.HTTP_CREATED) {
+ throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
+ }
+
+ BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
+
+ String output;
+ // 2.The server authenticates the credentials and, if they are valid, generate a
+ // token for the user.
+ System.out.println("Output from Server .... \n");
+ while ((output = br.readLine()) != null) {
+ JsonReader rdr = Json.createReader(br);
+ System.out.println("creates object");
+ // rdr.readObject();
+ System.out.println("obtain object" + rdr.toString());
+ System.out.println("prints output " + br.readLine());
+
+ JsonObject obj = rdr.readObject();
+ System.out.println("before reading object");
+
+ JsonArray results = obj.getJsonArray("AuthenticationResult");
+ // obj.getJsonString(arg0)
+ System.out.print("value type: " + results.getValueType());
+
+ // for (JsonObject result : results.getValuesAs(JsonObject.class)) {
+ // System.out.print("value type: "+results.getValueType());
+ // System.out.println("token"+ result.getString("IdToken"));
+ // }
+
+ System.out.println(output);
+ } // end of while
+
+ System.out.println("prints output 1" + br.readLine());
+
+ /// put object in hashmap somehow
+
+ // disconnects
+ conn.disconnect();
+
+ } catch (MalformedURLException e) {
+
+ e.printStackTrace();
+
+ } catch (IOException e) {
+
+ e.printStackTrace();
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/json/ConversionJSON2Object.java b/src/test/java/json/ConversionJSON2Object.java
new file mode 100644
index 0000000..d699a45
--- /dev/null
+++ b/src/test/java/json/ConversionJSON2Object.java
@@ -0,0 +1,30 @@
+package attendance.gson;
+
+import com.google.gson.Gson;
+
+import entity.LoginReply;
+
+public class ConversionJSON2Object {
+
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub: use a variable for the token
+
+ String replyJson = "{\"ChallengeParameters\":{},\"AuthenticationResult\":{\"AccessToken\":\"eyJraWQiOiJ6M2pWR1lscDVsS2VHVzRXMkwrU3BtdjN4UzIwWGFCU1FvZFlvdWg1WkU4PSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI2MWI5ZTI4NC1kMzVhLTQ0M2YtOTlhNy04MGY0OWE4YTI4NmQiLCJ0b2tlbl91c2UiOiJhY2Nlc3MiLCJzY29wZSI6ImF3cy5jb2duaXRvLnNpZ25pbi51c2VyLmFkbWluIiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfMEhkMUtvTTVhIiwiZXhwIjoxNTA1MTIwNzM1LCJpYXQiOjE1MDUxMTcxMzUsImp0aSI6ImNiMjdkZjJiLTIwOWQtNGU1MC05ZTI4LThjYTAyOGY1MTc5MyIsImNsaWVudF9pZCI6IjFlOHRlZm1sY2wyaDI5MHZuaDlyY2VmbnZyIiwidXNlcm5hbWUiOiIxMDI5NTc2NSJ9.ZGB_kCYoU4vDREr6teZQyIyRT2MZkpmGyleAgsgzMRIauq7RpqgL_HUZukqSK6E5mtNxux6hihzl5CaP9jcY26u4zJTnYASBJwE4iqqggNqhp82PtFdxipf5ZvYAyF3uVTPCeiRGrxJSyoQpEWVUPDYaqj1ak1b2oTExH8sG1oOmYcaACAWY4mkjueFJCrgcWov3SyWDyMKCE7ZhaloJkcJ2uZypztB42XQ67z96bxTvRozzEVEVT4_4szpMjEj3Nmxy9kIv8H7kNMUrb5tE4vTfG-kzctCq7YxU2FfJhDTR_feoRohcjWZp-Zyl2BYFjNXl42ZZEk-TlLHov73izA\",\"ExpiresIn\":3600,\"TokenType\":\"Bearer\",\"RefreshToken\":\"eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.Wa12tUlCQHIjWvDx8BdhyQdftCwlFXb5W99N8njK3vBTNiP2vUfCGgdbWTWCCg4Z9_4RkHRy9e9m2oQnLqWRju4pLDBQvhsd0XhGg43T6yalnH7vXpqmzDnsBS270CsN0briBlBiCTvmU2eVeauPxCKlW_-fFZFXJRmXdFCit-dhufODi08-SpZOnHKFSq9W4kjk3OjUxUONKCMAZh0oWgMKC-46Kh1j02NGej9vW-Dc7yaqAzMn3JcdQtjC8w9syqD3qJOo0eMbXoJz3cje7b-ujIlknsfmmy6rewoYIusxV_ZVP6QJH09k0QbVqbzZguE38hnbSMtrCnMAMr2Pzw.2T_M51x_qvo2s2Kg.gIpF-UmqE2-g9TuyypFAQwp7DsUNRBdqzwaaVlkUTpcX6Ni2YH-7fd9GOlzna_ET7pDbGCT4NL8xomo6hq_nOEQJvRdexvBc9Hpy_l_mIEG91W7wKzvDzjEben6ZnaxFg3XkRVL1o8nnjVswmrImuUqSJlisa2eSrf1wM7pK7l8l-CwbEZ-kutdCZGJU0EHk4_12D_0D9tJYppfM63SmNsTyTZkpHO4z1nmhxNuEPL0Jo2ClbxDDWALzvdee193x-d7KeCJw75gVLd64rhaUPATnW3JznhHlg2ZjTtwK1PBDRRMjd7gblgtOif6QXCAeUPGqmd7V2MtRw5pmcEgSF9kqRByvt9p1RPyBDkZw9K84LG0U1kuyA4_TIxvCX35wwUlBmF6UPO7AcM__zCxi7pKuAcOgfCsongWnjX97DZuT5INT3gnDz48GG3qguiEFuq1WSzJOQrkFFrVCJcjwfIbuxPJ6OTt6f6NKhwZqTMHgRpvtvNgSh7qARszqj2-HqkmrEgKdjUdLGEc-toS0mj9aTH8GOG6Xu4poEoIElDx8BjZGz4cOyT2VWL4BDFg3OzXfafEIu1F1SnhI9K4A59G8JR1H2UKZV7iGS2zMeMROWvtIzWrZ3M2BwWLlkM80BzpK1Xb2ZnQXfmY_-tVOojimji4z-hrLAKwvfbgEpGd9vLfItRZn2ivmsBSlc2da7zCqP7bHbtCHXpR5F-ssxP2G_UbIYraBr9m6GQPo1BXvveJFTFxd976hjbY5VyNwHFa0aR2a-sVDUDdPzoaBJQqA-xRQllwQYCGIcb-daBg4IDah_qthMPvDN9bblUpO4AJs8951wSCmaz3VqFnBAk9IHFSO1MRY5eMgH7cHn6vbzsScyb8S8C4hhdgx9uu9Kr30DaHrSZF8dYK0Y9n8K8sD-ZBXtKwhJL7F3tVdcnmFcGKLToV6xJnJnZ5irnOODMJMBPmOY5G3RYPd8lGvzlOfPDe0_lwUX8O1oCVOtiA2C9rOmrRTcaNKlP8R7uIVBOlFOypPMnwyqV233kGVE1Rp6RgCsw7ZIwOUNJmgLGZDLePocCBgZVrGE2GLVG78q6Z_agKjxjAOXEbtVOrk3QIycdyTVN2DEjzt88CW-fHeSqc6K4H5BiBf_zmlVaiSciPXsqg.zouwNDBSKRVFp88zPU2pUA\",\"IdToken\":\"eyJraWQiOiJKQWJRaHNlTTVldFRBMk1vMlpoNGs5Mlp2ZmFHaU5zWWtVQlFNbG1cL1Mybz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2MWI5ZTI4NC1kMzVhLTQ0M2YtOTlhNy04MGY0OWE4YTI4NmQiLCJhdWQiOiIxZTh0ZWZtbGNsMmgyOTB2bmg5cmNlZm52ciIsImNvZ25pdG86Z3JvdXBzIjpbImFkbWluaXN0cmF0b3IiXSwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTUwNTExNzEzNSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfMEhkMUtvTTVhIiwiY29nbml0bzp1c2VybmFtZSI6IjEwMjk1NzY1IiwiZXhwIjoxNTA1MTIwNzM1LCJpYXQiOjE1MDUxMTcxMzUsImVtYWlsIjoiam9uYXRoYW4udEB4dHJhLmNvLm56In0.gGcx2YYcjWzNvzlpPklry4Jt59GwDQuDRRIFfJGaf06hMKi0Cin31Ox7AD4CaRUmbUXzxh395Bb6bPS9cGdh5oa2hIveC27bwHpO7Eij6voEXdifS98_CTk_zKrAfH1U4qAHapemHA9eQqNnrGm0PtNHTo9Nh7ptrU_04Fc9askTjUnj3fOuDQTp1bLEJwwHbV7oBeQQlA6pYXvWvRwpj0col8N904w4QxoNNNEtYxIYbLtJkj3w-ZogJ9VPkKL_B3ayKTfle3nQ-PHrXyzYpBK89h39Hp2IiOddY-Ihl8iVuj8RziTUiMZ-0jTOToCAa8gQ813DGAtca0i4ffw3hg\"}}";
+
+ String jsonInString = "{'name' : 'martina perumal'}";
+
+ Gson gson = new Gson();
+
+ // Restaurant restaurantObject = gson.fromJson(restaurantJson,
+ // Restaurant.class);
+ LoginReply loginReplyObject = gson.fromJson(replyJson, LoginReply.class);
+
+ // Object loginReplyObject = gson.fromJson(replyJson, Object.class);
+
+ Girl girl = gson.fromJson(jsonInString, Girl.class);
+
+ System.out.println("value " + loginReplyObject.getAuthenticationResult().getIdToken());
+ System.out.println("value of her name " + girl.getName());
+ // System.out.println("obtain token "+ loginReplyObject.authenticationResult);
+ }
+}
diff --git a/src/test/java/json/ConversionJson2Map.java b/src/test/java/json/ConversionJson2Map.java
new file mode 100644
index 0000000..e6f491d
--- /dev/null
+++ b/src/test/java/json/ConversionJson2Map.java
@@ -0,0 +1,39 @@
+package attendance.gson;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ConversionJson2Map {
+
+ public static void main(String[] args) {
+ String jsonFromMS = "{\"ChallengeParameters\":{},\"AuthenticationResult\":{\"AccessToken\":\"eyJraWQiOiJ6M2pWR1lscDVsS2VHVzRXMkwrU3BtdjN4UzIwWGFCU1FvZFlvdWg1WkU4PSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI2MWI5ZTI4NC1kMzVhLTQ0M2YtOTlhNy04MGY0OWE4YTI4NmQiLCJ0b2tlbl91c2UiOiJhY2Nlc3MiLCJzY29wZSI6ImF3cy5jb2duaXRvLnNpZ25pbi51c2VyLmFkbWluIiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfMEhkMUtvTTVhIiwiZXhwIjoxNTA1MDg5NDY5LCJpYXQiOjE1MDUwODU4NjksImp0aSI6ImI4MzY3ZjcwLTA5MDktNGI0Mi1hNDI2LWM2ZTYyY2M3ZTI0YSIsImNsaWVudF9pZCI6IjFlOHRlZm1sY2wyaDI5MHZuaDlyY2VmbnZyIiwidXNlcm5hbWUiOiIxMDI5NTc2NSJ9.jfGvw9FX5-XBcVVaY21wL7F7Y6KRzRdLweCybx819JdRES2f-m4qGeftAZdzoRuLDJ4QfbGqJdJ1V19MKcw070qdz_zd3JFMo3ev9-1yrzQ9vr9hQR6Utk7cBLs_AGQlXHt2wNimvW7mPj_yyyjLa5LTveX0W-hZ5ZG2FSuiAE6dTmmSZs-FEjwZRPTNbjDVKHHr8QRBFq43gg23PkRCAriLO02ymrVblKCx_kqKvYbvNed_RB0IeGZP_Ll27F34-xdZz6r_zAcgxvOqafa5wPAbOvgCubE_rWviCujhgIa4qe_nqkqMIJhm0B3xOkG6K7Ju2yOy0rNSOzYI5JzRaA\",\"ExpiresIn\":3600,\"TokenType\":\"Bearer\",\"RefreshToken\":\"eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ.XHVc-4jvQzziSase9_kebv08iy9Ipi4WW-Ab4-VrEC3yPbzcKjd-pP_qbMhDENdnYofLBl_Safi7KEDSuDXNctflqwwLNW14mdLnV50JBSm9xTsd2XXN8L3O-yTSf20lYhMkr1r4SFSmLQWxO_er8yfJwEoeijP31qKNAvm2ld24f258jVcN2_pl845t1HFuuLLA0l4Q1KvVey1pcoB7rCCNE_YH6FN5Uh9cx8wPT7Y-VRzTZf5TrYUcm66vDadloQkztu4oj4-rcAFav0pHGMbxmA5Q5f8PTFHnTsShaWKa9axhBUtY5UNZHwlo5Mk88l1_tTJwgChPud6N_dZPDw.IumWp7H8XetEgUMF.0l5DHHyHKRzAPsc5U6RxL7DSQG1LC15ag0-PrqsT9ZCIq9LJK9GzDTgDLtYiUGKwmEnd4JyFNwr4Hs58QzqPQpO_SVpb15MO7zHgHAFwHochMlOClYUD6SFoU4vA4-_YK8yvz7kuIW6C-7TDgdxpyMZIAlpcCMSAyIqjAM7DkVxek6vNF2d8XqZI6mB88euvihBAeVUo94ut1fcRPZu-PhlFvb0zTwukQ0ScqUEaea4MFKevK_SIIdgefO22i1fXCBom530vkvqNzup34KUiN8qhuzN7pF_r6dNQAeBFzkdp7fYCOD_sK3pVsjQ6A91ZGTyNGoQ_umlcylljUEC0v5yVOSKAEL9waomujOIAN2Z9KmdYwe8ytnqlpAURKiP_3UwuEUld4ie2vduy_cvKAPuGbD1O_gVo7TXkQ8cdPDo6BBUAVL9hEsFslWzrR2NVXbiR27fsmj2IFke4ho8668pDyrL-P8QIjIRy3fPD4_7JfCR8xC4QIMMvFbilvTvhFHSDfYubV_K8xaa4xSoXZ2qxQdT8yIrD81yJZeGgcEai_ag-bmedxudG8YrTnAZTdU7wkdRSHSppAe6qouov3jwMMKkj55lkkGu4YUOqIt_ldutGecrEEhSI4N_4y4aNPbuWGdbhyqDGBF1JY0vgiGX1wFARUGGnlsDPeA-5FcnUqzm0kzWwlKmsGoiTLUi6uNzwWWOVzyht5T4fICyxp-BRTbSuK6lhmfeu796RItp6q6HzBSVHC0fC0sRJeHYiK6MEVEtDkIjY9R2p36raaxl7No5lV4L0LLFD0U3f3pizfT4BFM3jJ7JPad3InG3uJAlq2xOzGKC30Mo6AghO6xE8u2Z9P5ulewY2AI1b8-uQqFvhB-0Zd7vWpGqqkf7IMhXmwD-0PvCUr0sdDa3JhapnvGAzbVCpNhoZHPwOYns2wcvXOWrJH59icIgc18jHl4Nom-H3oPsALBpbnhA1TkVj5U-0N2yA2q8DopnKhsL5-1CMGgReMBUFMQb98Hu048gMmPY7iF3NHfWrUMreeCNMhSm_459YeRrp0osTBen_iqkxzEuJd4WOzC6l2Tg6UiFnRbhCMwvQs-dzlQwvJkXtzCwfv58EzP4R9UV1XFT2FufESkIfOhyM8ILwKKv3dilyrNs.hXpBG-_svaWFcmQvcxHuVA\",\"IdToken\":\"eyJraWQiOiJKQWJRaHNlTTVldFRBMk1vMlpoNGs5Mlp2ZmFHaU5zWWtVQlFNbG1cL1Mybz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2MWI5ZTI4NC1kMzVhLTQ0M2YtOTlhNy04MGY0OWE4YTI4NmQiLCJhdWQiOiIxZTh0ZWZtbGNsMmgyOTB2bmg5cmNlZm52ciIsImNvZ25pdG86Z3JvdXBzIjpbImFkbWluaXN0cmF0b3IiXSwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTUwNTA4NTg2OSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfMEhkMUtvTTVhIiwiY29nbml0bzp1c2VybmFtZSI6IjEwMjk1NzY1IiwiZXhwIjoxNTA1MDg5NDY5LCJpYXQiOjE1MDUwODU4NjksImVtYWlsIjoiam9uYXRoYW4udEB4dHJhLmNvLm56In0.N2vUTeKskoSGGnZNNQkoJrjqQSTwCRsAyoVzU8HoSESciE97PbHu_rsDBHdlIvExQgZOJUDH2fi2ZTVXL0qw_dw_1oy5PY0ss6iF9Ya8vNvwJ4QIg0nGLJEEWO6y9h81bUiy8WYOyC0uCy4FKPBzxu-VjO_ZkJwQZLlhkx56cPXhQI9JFbwQDeyxJDF9duOGiZkWYmiG842TeYpaNIiW46KtQ8kiZLGre9qUdPjQv9S-Ch9Cm8bDqVSunAVtTityUJMGJuxhM78hPAujGdeNfMX0qEx37MpKbQtkb_xJZaT1c0IXnu1tneqtGVxZtaZdQ4mUlBmdzamQaWhlSXvqyA\"}}";
+
+ Gson gson = new Gson();
+
+ Type authorization = new TypeToken