From 35b9ac057afbb8714212c4c264aea60446915caf Mon Sep 17 00:00:00 2001 From: Tess Stoddard Date: Wed, 10 Jun 2026 09:17:14 -0600 Subject: [PATCH] fix: restore versioned list payments and recurring payments --- mdx-gateway-generator/gradle.lockfile | 43 +++++++++-------- mdx-gateways/gradle.lockfile | 45 +++++++++--------- mdx-models/gradle.lockfile | 45 +++++++++--------- .../accessor/payment/PaymentBaseAccessor.java | 11 +++++ .../payment/RecurringPaymentBaseAccessor.java | 11 +++++ mdx-web/gradle.lockfile | 43 +++++++++-------- .../mdx/web/SpringMdxGatewayManager.java | 2 + .../web/controller/PaymentsController.java | 15 ++++-- .../RecurringPaymentsController.java | 17 +++++-- .../controller/PaymentsControllerTest.groovy | 27 +++++++++-- .../RecurringPaymentsControllerTest.groovy | 47 ++++++++++++++++++- realtime/gradle.lockfile | 45 +++++++++--------- 12 files changed, 232 insertions(+), 119 deletions(-) diff --git a/mdx-gateway-generator/gradle.lockfile b/mdx-gateway-generator/gradle.lockfile index ae0b67c3..847f525c 100644 --- a/mdx-gateway-generator/gradle.lockfile +++ b/mdx-gateway-generator/gradle.lockfile @@ -16,14 +16,13 @@ com.fasterxml.jackson:jackson-bom:2.21.2=compileClasspath,testCompileClasspath com.fasterxml.jackson:jackson-bom:2.21.3=runtimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:7.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.rholder:guava-retrying:2.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.spotbugs:spotbugs-annotations:4.10.2=compileClasspath,spotbugs,testCompileClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,testAnnotationProcessor +com.github.spotbugs:spotbugs:4.10.2=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,runtimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs -com.google.code.gson:gson:2.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.48.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.14.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.48.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.1.3-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -43,7 +42,7 @@ com.sun.xml.bind:jaxb-impl:4.0.6=compileClasspath,runtimeClasspath,testCompileCl commons-beanutils:commons-beanutils:1.11.0=runtimeClasspath,testRuntimeClasspath commons-codec:commons-codec:1.14=runtimeClasspath,testRuntimeClasspath commons-collections:commons-collections:3.2.2=runtimeClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs +commons-io:commons-io:2.21.0=spotbugs commons-logging:commons-logging:1.3.5=runtimeClasspath,testRuntimeClasspath io.github.cdimascio:dotenv-java:2.3.2=runtimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath @@ -53,20 +52,18 @@ io.opentracing:opentracing-util:0.33.0=compileClasspath,runtimeClasspath,testCom jakarta.activation:jakarta.activation-api:2.1.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.soap:jakarta.xml.soap-api:3.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs +jaxen:jaxen:2.0.6=spotbugs net.bytebuddy:byte-buddy-agent:1.17.7=testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.17.7=testCompileClasspath net.bytebuddy:byte-buddy:1.18.3=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-lang3:3.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.bcel:bcel:6.12.0=spotbugs +org.apache.commons:commons-lang3:3.20.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.14=runtimeClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.16=runtimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.25.3=spotbugs -org.apache.logging.log4j:log4j-core:2.25.3=spotbugs +org.apache.logging.log4j:log4j-api:2.26.0=spotbugs +org.apache.logging.log4j:log4j-core:2.26.0=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath org.assertj:assertj-core:3.27.7=testRuntimeClasspath org.checkerframework:checker-qual:3.37.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -86,22 +83,24 @@ org.javassist:javassist:3.28.0-GA=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.0=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.14.0=annotationProcessor,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:6.1.0=spotbugs org.mockito:mockito-core:5.23.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=runtimeClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-analysis:9.10.1=spotbugs +org.ow2.asm:asm-commons:9.10.1=spotbugs org.ow2.asm:asm-commons:9.8=jacocoAnt -org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=spotbugs org.ow2.asm:asm-tree:9.8=jacocoAnt -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm-util:9.10.1=spotbugs +org.ow2.asm:asm:9.10.1=spotbugs org.ow2.asm:asm:9.8=jacocoAnt -org.ow2.asm:asm:9.9=spotbugs org.projectlombok:lombok:1.18.42=annotationProcessor,compileClasspath,lombok,testAnnotationProcessor,testCompileClasspath org.reflections:reflections:0.10.2=runtimeClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.32=runtimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=spotbugs org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath diff --git a/mdx-gateways/gradle.lockfile b/mdx-gateways/gradle.lockfile index 18bcc2b6..4609254a 100644 --- a/mdx-gateways/gradle.lockfile +++ b/mdx-gateways/gradle.lockfile @@ -17,15 +17,16 @@ com.fasterxml.jackson:jackson-bom:2.21.3=annotationProcessor,runtimeClasspath,te com.fasterxml.woodstox:woodstox-core:7.1.1=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.oowekyala.ooxml:nice-xml-messages:3.1=pmd com.github.rholder:guava-retrying:2.0.0=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.spotbugs:spotbugs-annotations:4.10.2=compileClasspath,spotbugs,testCompileClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,testAnnotationProcessor +com.github.spotbugs:spotbugs:4.10.2=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,checkstyle,compileClasspath,runtimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=pmd,spotbugs -com.google.code.gson:gson:2.14.0=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=pmd +com.google.code.gson:gson:2.14.0=annotationProcessor,compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.36.0=checkstyle -com.google.errorprone:error_prone_annotations:2.41.0=pmd,spotbugs -com.google.errorprone:error_prone_annotations:2.48.0=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.41.0=pmd +com.google.errorprone:error_prone_annotations:2.48.0=annotationProcessor,compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.3=checkstyle com.google.guava:guava:32.1.3-jre=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,7 +51,7 @@ commons-beanutils:commons-beanutils:1.11.0=annotationProcessor,checkstyle,runtim commons-codec:commons-codec:1.14=annotationProcessor,runtimeClasspath,testRuntimeClasspath commons-codec:commons-codec:1.15=checkstyle commons-collections:commons-collections:3.2.2=annotationProcessor,checkstyle,runtimeClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs +commons-io:commons-io:2.21.0=spotbugs commons-logging:commons-logging:1.3.5=annotationProcessor,runtimeClasspath,testRuntimeClasspath info.picocli:picocli:4.7.7=checkstyle io.github.cdimascio:dotenv-java:2.3.2=annotationProcessor,runtimeClasspath,testRuntimeClasspath @@ -62,7 +63,7 @@ io.opentracing:opentracing-util:0.33.0=annotationProcessor,compileClasspath,runt jakarta.activation:jakarta.activation-api:2.1.4=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.soap:jakarta.xml.soap-api:3.0.2=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs +jaxen:jaxen:2.0.6=spotbugs net.bytebuddy:byte-buddy-agent:1.17.7=testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.17.7=testCompileClasspath net.bytebuddy:byte-buddy:1.18.3=testRuntimeClasspath @@ -73,12 +74,10 @@ net.sourceforge.pmd:pmd-core:7.22.0=pmd net.sourceforge.pmd:pmd-java:7.22.0=pmd org.antlr:antlr4-runtime:4.13.2=checkstyle org.antlr:antlr4-runtime:4.9.3=pmd -org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.bcel:bcel:6.12.0=spotbugs org.apache.commons:commons-lang3:3.18.0=checkstyle -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-lang3:3.20.0=annotationProcessor,compileClasspath,pmd,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.commons:commons-text:1.15.0=annotationProcessor,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.20.0=annotationProcessor,compileClasspath,pmd,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-text:1.15.0=annotationProcessor,compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-text:1.3=checkstyle org.apache.httpcomponents.client5:httpclient5:5.1.3=checkstyle org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=checkstyle @@ -87,8 +86,8 @@ org.apache.httpcomponents:httpclient:4.5.13=checkstyle org.apache.httpcomponents:httpclient:4.5.14=annotationProcessor,runtimeClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.14=checkstyle org.apache.httpcomponents:httpcore:4.4.16=annotationProcessor,runtimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.25.3=spotbugs -org.apache.logging.log4j:log4j-core:2.25.3=spotbugs +org.apache.logging.log4j:log4j-api:2.26.0=spotbugs +org.apache.logging.log4j:log4j-core:2.26.0=spotbugs org.apache.maven.doxia:doxia-core:1.12.0=checkstyle org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle @@ -120,18 +119,19 @@ org.jspecify:jspecify:1.0.0=checkstyle org.junit.jupiter:junit-jupiter-api:5.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.0=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.14.0=annotationProcessor,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:6.1.0=spotbugs org.mockito:mockito-core:5.23.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=annotationProcessor,runtimeClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-analysis:9.10.1=spotbugs +org.ow2.asm:asm-commons:9.10.1=spotbugs org.ow2.asm:asm-commons:9.8=jacocoAnt -org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=spotbugs org.ow2.asm:asm-tree:9.8=jacocoAnt -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm-util:9.10.1=spotbugs +org.ow2.asm:asm:9.10.1=spotbugs org.ow2.asm:asm:9.8=jacocoAnt -org.ow2.asm:asm:9.9=spotbugs org.ow2.asm:asm:9.9.1=pmd org.pcollections:pcollections:4.0.2=pmd org.projectlombok:lombok:1.18.42=annotationProcessor,compileClasspath,lombok,testAnnotationProcessor,testCompileClasspath @@ -139,7 +139,8 @@ org.reflections:reflections:0.10.2=annotationProcessor,checkstyle,runtimeClasspa org.slf4j:jul-to-slf4j:1.7.36=pmd org.slf4j:slf4j-api:1.7.30=testCompileClasspath org.slf4j:slf4j-api:1.7.32=annotationProcessor,runtimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=spotbugs org.slf4j:slf4j-simple:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath diff --git a/mdx-models/gradle.lockfile b/mdx-models/gradle.lockfile index 7efa359e..fdabffcf 100644 --- a/mdx-models/gradle.lockfile +++ b/mdx-models/gradle.lockfile @@ -17,15 +17,16 @@ com.fasterxml.jackson:jackson-bom:2.21.3=runtimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:7.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.oowekyala.ooxml:nice-xml-messages:3.1=pmd com.github.rholder:guava-retrying:2.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.spotbugs:spotbugs-annotations:4.10.2=compileClasspath,spotbugs,testCompileClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,testAnnotationProcessor +com.github.spotbugs:spotbugs:4.10.2=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,checkstyle,compileClasspath,runtimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=pmd,spotbugs -com.google.code.gson:gson:2.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=pmd +com.google.code.gson:gson:2.14.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.36.0=checkstyle -com.google.errorprone:error_prone_annotations:2.41.0=pmd,spotbugs -com.google.errorprone:error_prone_annotations:2.48.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.41.0=pmd +com.google.errorprone:error_prone_annotations:2.48.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.3=checkstyle com.google.guava:guava:32.1.3-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,7 +49,7 @@ commons-beanutils:commons-beanutils:1.11.0=checkstyle,compileClasspath,runtimeCl commons-codec:commons-codec:1.14=runtimeClasspath,testRuntimeClasspath commons-codec:commons-codec:1.15=checkstyle commons-collections:commons-collections:3.2.2=checkstyle,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs +commons-io:commons-io:2.21.0=spotbugs commons-logging:commons-logging:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath info.picocli:picocli:4.7.7=checkstyle io.github.cdimascio:dotenv-java:2.3.2=runtimeClasspath,testRuntimeClasspath @@ -59,7 +60,7 @@ io.opentracing:opentracing-util:0.33.0=compileClasspath,runtimeClasspath,testCom jakarta.activation:jakarta.activation-api:2.1.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.soap:jakarta.xml.soap-api:3.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs +jaxen:jaxen:2.0.6=spotbugs net.bytebuddy:byte-buddy-agent:1.17.7=testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.17.7=testCompileClasspath net.bytebuddy:byte-buddy:1.18.3=testRuntimeClasspath @@ -70,12 +71,10 @@ net.sourceforge.pmd:pmd-core:7.22.0=pmd net.sourceforge.pmd:pmd-java:7.22.0=pmd org.antlr:antlr4-runtime:4.13.2=checkstyle org.antlr:antlr4-runtime:4.9.3=pmd -org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.bcel:bcel:6.12.0=spotbugs org.apache.commons:commons-lang3:3.18.0=checkstyle -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-lang3:3.20.0=compileClasspath,pmd,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.20.0=compileClasspath,pmd,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-text:1.3=checkstyle org.apache.httpcomponents.client5:httpclient5:5.1.3=checkstyle org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=checkstyle @@ -84,8 +83,8 @@ org.apache.httpcomponents:httpclient:4.5.13=checkstyle org.apache.httpcomponents:httpclient:4.5.14=runtimeClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.14=checkstyle org.apache.httpcomponents:httpcore:4.4.16=runtimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.25.3=spotbugs -org.apache.logging.log4j:log4j-core:2.25.3=spotbugs +org.apache.logging.log4j:log4j-api:2.26.0=spotbugs +org.apache.logging.log4j:log4j-core:2.26.0=spotbugs org.apache.maven.doxia:doxia-core:1.12.0=checkstyle org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle @@ -117,25 +116,27 @@ org.jspecify:jspecify:1.0.0=checkstyle org.junit.jupiter:junit-jupiter-api:5.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.0=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.14.0=annotationProcessor,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:6.1.0=spotbugs org.mockito:mockito-core:5.23.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=runtimeClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-analysis:9.10.1=spotbugs +org.ow2.asm:asm-commons:9.10.1=spotbugs org.ow2.asm:asm-commons:9.8=jacocoAnt -org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=spotbugs org.ow2.asm:asm-tree:9.8=jacocoAnt -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm-util:9.10.1=spotbugs +org.ow2.asm:asm:9.10.1=spotbugs org.ow2.asm:asm:9.8=jacocoAnt -org.ow2.asm:asm:9.9=spotbugs org.ow2.asm:asm:9.9.1=pmd org.pcollections:pcollections:4.0.2=pmd org.projectlombok:lombok:1.18.42=annotationProcessor,compileClasspath,lombok,testAnnotationProcessor,testCompileClasspath org.reflections:reflections:0.10.2=checkstyle,runtimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=pmd org.slf4j:slf4j-api:1.7.32=runtimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=spotbugs org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath diff --git a/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/PaymentBaseAccessor.java b/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/PaymentBaseAccessor.java index abb294e8..bf4eb852 100644 --- a/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/PaymentBaseAccessor.java +++ b/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/PaymentBaseAccessor.java @@ -194,6 +194,17 @@ public AccessorResponse> list() { throw new AccessorMethodNotImplementedException(); } + /** + * List all payments - Version 20260427 + * + * @return + */ + @GatewayAPI + @API(description = "List all payments version 20260427") + public AccessorResponse> list20260427() { + throw new AccessorMethodNotImplementedException(); + } + /** * Accessor for bill operations * diff --git a/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/RecurringPaymentBaseAccessor.java b/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/RecurringPaymentBaseAccessor.java index a8895df4..8823b8e1 100644 --- a/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/RecurringPaymentBaseAccessor.java +++ b/mdx-models/src/main/java/com/mx/path/model/mdx/accessor/payment/RecurringPaymentBaseAccessor.java @@ -78,6 +78,17 @@ public AccessorResponse> list() { throw new AccessorMethodNotImplementedException(); } + /** + * List all recurring payments - Version 20260427 + * + * @return + */ + @GatewayAPI + @API(description = "List all payments version 20260427") + public AccessorResponse> list20260427() { + throw new AccessorMethodNotImplementedException(); + } + /** * Cancel a recurring payment * diff --git a/mdx-web/gradle.lockfile b/mdx-web/gradle.lockfile index 9cc52008..9349233b 100644 --- a/mdx-web/gradle.lockfile +++ b/mdx-web/gradle.lockfile @@ -23,13 +23,16 @@ com.fasterxml.jackson:jackson-bom:2.21.3=runtimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:7.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.oowekyala.ooxml:nice-xml-messages:3.1=pmd com.github.rholder:guava-retrying:2.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.spotbugs:spotbugs-annotations:4.10.2=compileClasspath,spotbugs,testCompileClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,testAnnotationProcessor +com.github.spotbugs:spotbugs:4.10.2=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,checkstyle,compileClasspath,runtimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=compileClasspath,pmd,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=compileClasspath,pmd,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.14.0=spotbugs com.google.errorprone:error_prone_annotations:2.36.0=checkstyle -com.google.errorprone:error_prone_annotations:2.41.0=compileClasspath,pmd,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.41.0=compileClasspath,pmd,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.48.0=spotbugs com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.3=checkstyle com.google.guava:guava:32.1.3-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,7 +58,7 @@ commons-codec:commons-codec:1.15=checkstyle commons-codec:commons-codec:1.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath commons-collections:commons-collections:3.2.2=checkstyle,runtimeClasspath,testRuntimeClasspath commons-io:commons-io:2.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs +commons-io:commons-io:2.21.0=spotbugs commons-logging:commons-logging:1.3.5=runtimeClasspath,testRuntimeClasspath info.picocli:picocli:4.7.7=checkstyle io.github.cdimascio:dotenv-java:2.3.2=runtimeClasspath,testRuntimeClasspath @@ -70,7 +73,7 @@ jakarta.activation:jakarta.activation-api:2.1.4=compileClasspath,runtimeClasspat jakarta.annotation:jakarta.annotation-api:2.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.soap:jakarta.xml.soap-api:3.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs +jaxen:jaxen:2.0.6=spotbugs net.bytebuddy:byte-buddy-agent:1.17.8=testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.18.3=testCompileClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.5.2=testCompileClasspath,testRuntimeClasspath @@ -82,12 +85,10 @@ net.sourceforge.pmd:pmd-core:7.22.0=pmd net.sourceforge.pmd:pmd-java:7.22.0=pmd org.antlr:antlr4-runtime:4.13.2=checkstyle org.antlr:antlr4-runtime:4.9.3=pmd -org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.bcel:bcel:6.12.0=spotbugs org.apache.commons:commons-lang3:3.18.0=checkstyle -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-lang3:3.20.0=compileClasspath,pmd,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.20.0=compileClasspath,pmd,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-text:1.3=checkstyle org.apache.httpcomponents.client5:httpclient5:5.1.3=checkstyle org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=checkstyle @@ -97,8 +98,8 @@ org.apache.httpcomponents:httpclient:4.5.14=runtimeClasspath,testRuntimeClasspat org.apache.httpcomponents:httpcore:4.4.14=checkstyle org.apache.httpcomponents:httpcore:4.4.16=runtimeClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.24.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.25.3=spotbugs -org.apache.logging.log4j:log4j-core:2.25.3=spotbugs +org.apache.logging.log4j:log4j-api:2.26.0=spotbugs +org.apache.logging.log4j:log4j-core:2.26.0=spotbugs org.apache.logging.log4j:log4j-to-slf4j:2.24.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.maven.doxia:doxia-core:1.12.0=checkstyle org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle @@ -139,20 +140,21 @@ org.junit.jupiter:junit-jupiter:5.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.0=testRuntimeClasspath -org.junit:junit-bom:5.14.0=annotationProcessor,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:6.1.0=spotbugs org.mockito:mockito-core:5.17.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:5.17.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=runtimeClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-analysis:9.10.1=spotbugs +org.ow2.asm:asm-commons:9.10.1=spotbugs org.ow2.asm:asm-commons:9.8=jacocoAnt -org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=spotbugs org.ow2.asm:asm-tree:9.8=jacocoAnt -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm-util:9.10.1=spotbugs +org.ow2.asm:asm:9.10.1=spotbugs org.ow2.asm:asm:9.7.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.8=jacocoAnt -org.ow2.asm:asm:9.9=spotbugs org.ow2.asm:asm:9.9.1=pmd org.pcollections:pcollections:4.0.2=pmd org.projectlombok:lombok:1.18.42=annotationProcessor,lombok,testAnnotationProcessor @@ -161,7 +163,8 @@ org.reflections:reflections:0.10.2=checkstyle,runtimeClasspath,testRuntimeClassp org.skyscreamer:jsonassert:1.5.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=pmd org.slf4j:jul-to-slf4j:2.0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=compileClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=compileClasspath,runtimeClasspath,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.18=spotbugs org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath diff --git a/mdx-web/src/main/java/com/mx/path/model/mdx/web/SpringMdxGatewayManager.java b/mdx-web/src/main/java/com/mx/path/model/mdx/web/SpringMdxGatewayManager.java index 3e49f8b7..a64e1732 100644 --- a/mdx-web/src/main/java/com/mx/path/model/mdx/web/SpringMdxGatewayManager.java +++ b/mdx-web/src/main/java/com/mx/path/model/mdx/web/SpringMdxGatewayManager.java @@ -162,6 +162,7 @@ public static void registerGatewayFileContentPreprocessor(ConsumerThis class is loaded by Spring. If reset is called on it, there is no way for Spring to know it needs to be reinitialized. */ + @SuppressFBWarnings("USO_UNSAFE_STATIC_METHOD_SYNCHRONIZATION") public static synchronized void reset() { configurator = new GatewayConfigurator(); gateways = null; @@ -175,6 +176,7 @@ public static synchronized void reset() { /** * Use {@link #reset()} */ + @SuppressFBWarnings("USO_UNSAFE_STATIC_METHOD_SYNCHRONIZATION") @Deprecated public static synchronized void resetAfterInitialized() { initialized = false; diff --git a/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/PaymentsController.java b/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/PaymentsController.java index 0f49df8b..6a164953 100644 --- a/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/PaymentsController.java +++ b/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/PaymentsController.java @@ -90,10 +90,19 @@ public final ResponseEntity createPayment(@RequestBody Payment paymentR return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); } + @SuppressWarnings({ "MagicNumber", "unchecked" }) @RequestMapping(value = "/payments", method = RequestMethod.GET) - public final ResponseEntity> getPaymentList() { - AccessorResponse> response = gateway().payments().list(); - return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); + public final ResponseEntity> getPaymentList(HttpServletRequest request) { + return (ResponseEntity>) versioned(request) + .defaultVersion(MdxList.class, MdxList.class, payments -> { + AccessorResponse> response = gateway().payments().list(); + return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); + }) + .version(20260427, MdxList.class, MdxList.class, payments -> { + AccessorResponse> response = gateway().payments().list20260427(); + return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); + }) + .execute(); } @RequestMapping(value = "/payments/{id}", method = RequestMethod.GET) diff --git a/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/RecurringPaymentsController.java b/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/RecurringPaymentsController.java index 4aa2fab5..62b486da 100644 --- a/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/RecurringPaymentsController.java +++ b/mdx-web/src/main/java/com/mx/path/model/mdx/web/controller/RecurringPaymentsController.java @@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import jakarta.servlet.http.HttpServletRequest; + @RestController @RequestMapping(value = "{clientId}", produces = BaseController.MDX_MEDIA) public class RecurringPaymentsController extends BaseController { @@ -23,10 +25,19 @@ public final ResponseEntity> getRecurringPaymentFrequencies() return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); } + @SuppressWarnings({ "MagicNumber", "unchecked" }) @RequestMapping(value = "/users/{userId}/recurring_payments", method = RequestMethod.GET) - public final ResponseEntity> getRecurringPayments() { - AccessorResponse> response = gateway().payments().recurring().list(); - return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); + public final ResponseEntity> getRecurringPayments(HttpServletRequest request) { + return (ResponseEntity>) versioned(request) + .defaultVersion(MdxList.class, MdxList.class, recurringPayments -> { + AccessorResponse> response = gateway().payments().recurring().list(); + return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); + }) + .version(20260427, MdxList.class, MdxList.class, recurringPayments -> { + AccessorResponse> response = gateway().payments().recurring().list20260427(); + return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK); + }) + .execute(); } @RequestMapping(value = "/users/{userId}/recurring_payments", method = RequestMethod.POST, consumes = MDX_MEDIA) diff --git a/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/PaymentsControllerTest.groovy b/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/PaymentsControllerTest.groovy index 21e0fa88..4bba4900 100644 --- a/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/PaymentsControllerTest.groovy +++ b/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/PaymentsControllerTest.groovy @@ -68,18 +68,39 @@ class PaymentsControllerTest extends Specification { BaseController.setGateway(gateway) def payment = new Payment() - def payments = new MdxList<>().tap { add(payment) } + def payments = new MdxList().tap { add(payment) } when: Mockito.doReturn(new AccessorResponse>().withResult(payments)).when(paymentGateway).list() - def response = subject.getPaymentList() + def response = subject.getPaymentList(buildRequest(null, "application/vnd.mx.mdx.v6+json")) then: + response.body instanceof MdxList + response.body == payments HttpStatus.OK == response.getStatusCode() - response.getBody() == payments verify(paymentGateway).list() || true } + + def "getPayments v20260427 interacts with gateway"() { + given: + BaseController.setGateway(gateway) + + def payment = new Payment() + def payments = new MdxList().tap { add(payment) } + + when: + Mockito.doReturn(new AccessorResponse>().withResult(payments)).when(paymentGateway).list20260427() + def response = subject.getPaymentList(buildRequest(null, "application/vnd.mx.mdx.v6+json;version=20260427")) + + then: + response.body instanceof MdxList + response.getBody() == payments + HttpStatus.OK == response.getStatusCode() + verify(paymentGateway).list20260427() || true + } + + def "createPayment interacts with gateway"() { given: BaseController.setGateway(gateway) diff --git a/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/RecurringPaymentsControllerTest.groovy b/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/RecurringPaymentsControllerTest.groovy index bad4a1b7..2b2078eb 100644 --- a/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/RecurringPaymentsControllerTest.groovy +++ b/mdx-web/src/test/groovy/com/mx/path/model/mdx/web/controller/RecurringPaymentsControllerTest.groovy @@ -1,14 +1,20 @@ package com.mx.path.model.mdx.web.controller +import static org.mockito.Mockito.mock import static org.mockito.Mockito.spy import static org.mockito.Mockito.verify +import static org.mockito.Mockito.when +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import com.mx.path.core.context.Session import com.mx.path.gateway.accessor.AccessorResponse import com.mx.path.gateway.api.Gateway import com.mx.path.gateway.api.payment.PaymentGateway import com.mx.path.gateway.api.payment.RecurringPaymentGateway import com.mx.path.model.mdx.model.Frequency import com.mx.path.model.mdx.model.MdxList +import com.mx.path.model.mdx.model.Resources import com.mx.path.model.mdx.model.payment.RecurringPayment import org.mockito.Mockito @@ -16,17 +22,24 @@ import org.springframework.http.HttpStatus import spock.lang.Specification +import jakarta.servlet.http.HttpServletRequest + class RecurringPaymentsControllerTest extends Specification { RecurringPaymentsController subject Gateway gateway PaymentGateway paymentGateway RecurringPaymentGateway recurringPaymentGateway + Gson gson def setup() { subject = new RecurringPaymentsController() recurringPaymentGateway = spy(RecurringPaymentGateway.builder().build()) paymentGateway = PaymentGateway.builder().recurring(recurringPaymentGateway).build() gateway = Gateway.builder().payments(paymentGateway).build() + + GsonBuilder builder = new GsonBuilder() + Resources.registerResources(builder) + gson = builder.create() } def cleanup() { @@ -58,11 +71,29 @@ class RecurringPaymentsControllerTest extends Specification { when: Mockito.doReturn(new AccessorResponse>().withResult(recurringPayments)).when(recurringPaymentGateway).list() - def response = subject.getRecurringPayments() + def response = subject.getRecurringPayments(buildRequest(null, "application/vnd.mx.mdx.v6+json")) then: + response.body instanceof MdxList + response.body == recurringPayments verify(recurringPaymentGateway).list() || true - response.getBody() == recurringPayments + } + + def "index recurring payments v20260427 invokes gateway"() { + given: + RecurringPayment recurringPayment = new RecurringPayment() + MdxList recurringPayments = new MdxList<>() + recurringPayments.add(recurringPayment) + BaseController.setGateway(gateway) + + when: + Mockito.doReturn(new AccessorResponse>().withResult(recurringPayments)).when(recurringPaymentGateway).list20260427() + def response = subject.getRecurringPayments(buildRequest(null, "application/vnd.mx.mdx.v6+json;version=20260427")) + + then: + response.body instanceof MdxList + response.body == recurringPayments + verify(recurringPaymentGateway).list20260427() || true } def "get recurring payment invokes gateway"() { @@ -126,4 +157,16 @@ class RecurringPaymentsControllerTest extends Specification { verify(recurringPaymentGateway).cancel(recurringPayment.id) || true HttpStatus.NO_CONTENT == response.getStatusCode() } + + def buildRequest(Object body, String contentType) { + HttpServletRequest request = mock(HttpServletRequest.class) + when(request.getReader()).thenReturn(new BufferedReader(new StringReader(gson.toJson(body)))) + if (Session.current() != null) { + when(request.getHeader("mx-session-key")).thenReturn(Session.current().getId()) + } + when(request.getHeaders("Content-Type")).thenReturn(Collections.enumeration([contentType])) + when(request.getHeaders("Accept")).thenReturn(Collections.enumeration([contentType])) + + return request + } } diff --git a/realtime/gradle.lockfile b/realtime/gradle.lockfile index 15b40749..0c77da78 100644 --- a/realtime/gradle.lockfile +++ b/realtime/gradle.lockfile @@ -17,15 +17,16 @@ com.fasterxml.jackson:jackson-bom:2.21.3=runtimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:7.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.oowekyala.ooxml:nice-xml-messages:3.1=pmd com.github.rholder:guava-retrying:2.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.spotbugs:spotbugs-annotations:4.10.2=compileClasspath,spotbugs,testCompileClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=annotationProcessor,testAnnotationProcessor +com.github.spotbugs:spotbugs:4.10.2=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,checkstyle,compileClasspath,runtimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=pmd,spotbugs -com.google.code.gson:gson:2.14.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=pmd +com.google.code.gson:gson:2.14.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.36.0=checkstyle -com.google.errorprone:error_prone_annotations:2.41.0=pmd,spotbugs -com.google.errorprone:error_prone_annotations:2.48.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.41.0=pmd +com.google.errorprone:error_prone_annotations:2.48.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.3=checkstyle com.google.guava:guava:32.1.3-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,7 +50,7 @@ commons-beanutils:commons-beanutils:1.11.0=checkstyle,runtimeClasspath,testRunti commons-codec:commons-codec:1.14=runtimeClasspath,testRuntimeClasspath commons-codec:commons-codec:1.15=checkstyle commons-collections:commons-collections:3.2.2=checkstyle,runtimeClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs +commons-io:commons-io:2.21.0=spotbugs commons-logging:commons-logging:1.3.5=runtimeClasspath,testRuntimeClasspath info.picocli:picocli:4.7.7=checkstyle io.github.cdimascio:dotenv-java:2.3.2=runtimeClasspath,testRuntimeClasspath @@ -60,7 +61,7 @@ io.opentracing:opentracing-util:0.33.0=compileClasspath,runtimeClasspath,testCom jakarta.activation:jakarta.activation-api:2.1.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.soap:jakarta.xml.soap-api:3.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs +jaxen:jaxen:2.0.6=spotbugs net.bytebuddy:byte-buddy-agent:1.17.7=testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.17.7=testCompileClasspath net.bytebuddy:byte-buddy:1.18.3=testRuntimeClasspath @@ -71,12 +72,10 @@ net.sourceforge.pmd:pmd-core:7.22.0=pmd net.sourceforge.pmd:pmd-java:7.22.0=pmd org.antlr:antlr4-runtime:4.13.2=checkstyle org.antlr:antlr4-runtime:4.9.3=pmd -org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.bcel:bcel:6.12.0=spotbugs org.apache.commons:commons-lang3:3.18.0=checkstyle -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-lang3:3.20.0=compileClasspath,pmd,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.20.0=compileClasspath,pmd,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-text:1.15.0=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-text:1.3=checkstyle org.apache.httpcomponents.client5:httpclient5:5.1.3=checkstyle org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=checkstyle @@ -85,8 +84,8 @@ org.apache.httpcomponents:httpclient:4.5.13=checkstyle org.apache.httpcomponents:httpclient:4.5.14=runtimeClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.14=checkstyle org.apache.httpcomponents:httpcore:4.4.16=runtimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.25.3=spotbugs -org.apache.logging.log4j:log4j-core:2.25.3=spotbugs +org.apache.logging.log4j:log4j-api:2.26.0=spotbugs +org.apache.logging.log4j:log4j-core:2.26.0=spotbugs org.apache.maven.doxia:doxia-core:1.12.0=checkstyle org.apache.maven.doxia:doxia-logging-api:1.12.0=checkstyle org.apache.maven.doxia:doxia-module-xdoc:1.12.0=checkstyle @@ -118,25 +117,27 @@ org.jspecify:jspecify:1.0.0=checkstyle org.junit.jupiter:junit-jupiter-api:5.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.0=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.0=testCompileClasspath,testRuntimeClasspath -org.junit:junit-bom:5.14.0=annotationProcessor,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:6.1.0=spotbugs org.mockito:mockito-core:5.23.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=runtimeClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-analysis:9.10.1=spotbugs +org.ow2.asm:asm-commons:9.10.1=spotbugs org.ow2.asm:asm-commons:9.8=jacocoAnt -org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=spotbugs org.ow2.asm:asm-tree:9.8=jacocoAnt -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm-util:9.10.1=spotbugs +org.ow2.asm:asm:9.10.1=spotbugs org.ow2.asm:asm:9.8=jacocoAnt -org.ow2.asm:asm:9.9=spotbugs org.ow2.asm:asm:9.9.1=pmd org.pcollections:pcollections:4.0.2=pmd org.projectlombok:lombok:1.18.42=annotationProcessor,compileClasspath,lombok,testAnnotationProcessor,testCompileClasspath org.reflections:reflections:0.10.2=checkstyle,runtimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=pmd org.slf4j:slf4j-api:1.7.32=runtimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=spotbugs org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-M6-groovy-3.0=testCompileClasspath,testRuntimeClasspath