From 1a6f5e1f7912269185cc29dda27b3e7dfa115e34 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Thu, 11 Jul 2024 22:24:28 +0530 Subject: [PATCH 1/4] Checking classpath --- .../sample/SampleCodeTest/TestRunner.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java b/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java index 60ad084a..92f2f6fa 100644 --- a/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java +++ b/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java @@ -92,6 +92,7 @@ private static Double getAmount() double d = (double)(1.05 + (450.0 * rgenerator.nextDouble())); DecimalFormat df = new DecimalFormat("#.##"); d = Double.valueOf(df.format(d)); + System.out.println("AMOUNT : " + d); return d; } @@ -109,6 +110,8 @@ public void TestAllSampleCodes() BufferedReader reader = null; + System.out.println(System.getProperty("java.class.path")); + try { reader = new BufferedReader(new FileReader(fileName)); } catch (FileNotFoundException e1) { @@ -183,7 +186,7 @@ public ANetApiResponse InvokeRunMethod(String className) { String fqClassName = "net.authorize.sample." + className; - Class classType = null; + Class classType = null; try { classType = Class.forName(fqClassName); } catch (ClassNotFoundException e1) { @@ -193,28 +196,19 @@ public ANetApiResponse InvokeRunMethod(String className) Method runMethod = null; try { - runMethod = classType.getMethod("run",String.class, String.class); - } catch (NoSuchMethodException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (SecurityException e1) { + runMethod = classType.getMethod("run", String.class, String.class); + } catch (NoSuchMethodException | SecurityException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } - try { + try { return (ANetApiResponse)runMethod.invoke(null, Constants.API_LOGIN_ID, Constants.TRANSACTION_KEY); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalArgumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (InvocationTargetException e) { + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } - return null; + return null; } public ANetApiResponse TestValidateCustomerPaymentProfile() From dbf0135dd15c775c635f7fd5d4176dfb572dd13a Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 12 Jul 2024 13:06:07 +0530 Subject: [PATCH 2/4] Removed testing comments --- .../java/net/authorize/sample/SampleCodeTest/TestRunner.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java b/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java index 92f2f6fa..b6551189 100644 --- a/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java +++ b/src/test/java/net/authorize/sample/SampleCodeTest/TestRunner.java @@ -92,7 +92,6 @@ private static Double getAmount() double d = (double)(1.05 + (450.0 * rgenerator.nextDouble())); DecimalFormat df = new DecimalFormat("#.##"); d = Double.valueOf(df.format(d)); - System.out.println("AMOUNT : " + d); return d; } @@ -110,8 +109,6 @@ public void TestAllSampleCodes() BufferedReader reader = null; - System.out.println(System.getProperty("java.class.path")); - try { reader = new BufferedReader(new FileReader(fileName)); } catch (FileNotFoundException e1) { From 68db99ee7ed6cfa93cba131360fa4c93c82d026f Mon Sep 17 00:00:00 2001 From: gnongsie Date: Fri, 12 Jul 2024 13:07:40 +0530 Subject: [PATCH 3/4] Upgraded to work on Java 9 and above. --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 26c91e27..ae61d0b0 100644 --- a/pom.xml +++ b/pom.xml @@ -28,8 +28,8 @@ maven-compiler-plugin 3.7.0 - 1.7 - 1.7 + 9 + 9 From 49e50bbf600b7ac2486184f4d0588b1c1e65eff0 Mon Sep 17 00:00:00 2001 From: gnongsie Date: Thu, 19 Sep 2024 13:18:50 +0530 Subject: [PATCH 4/4] Upgrades to latest versions --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ae61d0b0..f456c3e3 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ net.authorize anet-java-sdk - 2.0.5 + 3.0.0 junit