From db7c28447c927bbcbb324a7ec523c4e7a51fe267 Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Wed, 1 Jun 2022 12:35:18 +0100 Subject: [PATCH 1/3] Initial version for 0.23.x Signed-off-by: Pierre-Alexandre Meyer --- .github/workflows/ci.yml | 19 +++ .github/workflows/codeql-analysis.yml | 10 ++ .travis.yml | 41 ------- README.md | 11 +- docker/docker-compose.ci.mysql.yml | 41 +++++++ docker/docker-compose.ci.postgresql.yml | 41 +++++++ pom.xml | 114 +++++++++--------- spotbugs-exclude.xml | 3 + src/main/resources/ddl-postgresql.sql | 21 ++++ src/main/resources/ddl.sql | 2 +- .../plugin/payment/EmbeddedDbHelper.java | 3 + 11 files changed, 200 insertions(+), 106 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .travis.yml create mode 100644 docker/docker-compose.ci.mysql.yml create mode 100644 docker/docker-compose.ci.postgresql.yml create mode 100644 src/main/resources/ddl-postgresql.sql diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d3e2d9b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: ci + +on: + - push + - workflow_dispatch + +jobs: + ci: + uses: killbill/gh-actions-shared/.github/workflows/ci.yml@main + with: + test-profile-matrix: '[ "travis", "integration-mysql", "integration-postgresql" ]' + + integration_test: + uses: killbill/gh-actions-shared/.github/workflows/integration_test.yml@main + with: + plugin_name: 'payment-test' + integration_tests_goal: 'ci:payment-test' + ddl_file: 'src/main/resources/ddl.sql' + integration_tests_ref: 'refs/heads/integration-tests' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..c150684 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,10 @@ +name: CodeQL + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + analyze: + uses: killbill/gh-actions-shared/.github/workflows/codeql-analysis.yml@main diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d4be300..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: ruby - -sudo: false -cache: bundler - -before_script: - - bundle exec jbundle install - -script: 'bundle exec rake spec' - -notifications: - email: - - kill-bill-commits@googlegroups.com - -env: - global: - - JRUBY_OPTS='-J-Xmx1024M' - -rvm: - - jruby-1.7.20 - - jruby-20mode # latest 1.7.x - - jruby-head - -gemfile: - - Gemfile - - Gemfile.head - -jdk: - - openjdk7 - - oraclejdk7 - - oraclejdk8 - -matrix: - allow_failures: - - rvm: jruby-head - - jdk: oraclejdk8 - - gemfile: Gemfile.head - fast_finish: true - -after_success: - - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && echo "sonatype-nexus-snapshots\${env.OSSRH_USER}\${env.OSSRH_PASS}" > ~/settings.xml && MVN="mvn --settings $HOME/settings.xml" NO_RELEASE=1 travis_retry travis_wait bash release.sh | egrep -v "Download|Install|Upload" ; rm -f ~/settings.xml' diff --git a/README.md b/README.md index 0f963d4..ec11a2b 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,12 @@ Kill Bill compatibility ----------------------- | Plugin version | Kill Bill version | -| -------------: | ----------------: | -| 4.x.y | 0.18.z | -| 5.x.y | 0.19.z | -| 6.x.y | 0.20.z | -| 7.x.y | 0.22.z | +|---------------:|------------------:| +| 4.x.y | 0.18.z | +| 5.x.y | 0.19.z | +| 6.x.y | 0.20.z | +| 7.x.y | 0.22.z | +| 8.x.y | 0.23.z | Requirements diff --git a/docker/docker-compose.ci.mysql.yml b/docker/docker-compose.ci.mysql.yml new file mode 100644 index 0000000..91a6cd6 --- /dev/null +++ b/docker/docker-compose.ci.mysql.yml @@ -0,0 +1,41 @@ +# +# Copyright 2020-2022 Equinix, Inc +# Copyright 2014-2022 The Billing Project, LLC +# +# The Billing Project licenses this file to you 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: +# +# http://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. +# + +version: '3.8' + +services: + killbill: + network_mode: host + image: killbill/killbill:0.23.0-9116fa4-SNAPSHOT + environment: + - KILLBILL_CATALOG_URI=SpyCarAdvanced.xml + - KILLBILL_DAO_URL=jdbc:mysql://127.0.0.1:3306/killbill + - KILLBILL_DAO_USER=root + - KILLBILL_DAO_PASSWORD=root + - KILLBILL_SERVER_TEST_MODE=true + - KILLBILL_INVOICE_SANITY_SAFETY_BOUND_ENABLED=false + - KILLBILL_INVOICE_MAX_DAILY_NUMBER_OF_ITEMS_SAFETY_BOUND=-1 + depends_on: + - db + volumes: + - /var/tmp/bundles/plugins/java/payment-test-plugin:/var/lib/killbill/bundles/plugins/java/payment-test-plugin + - /var/tmp/tomcat_logs:/var/lib/tomcat/logs + db: + network_mode: host + image: killbill/mariadb:0.23 + environment: + - MYSQL_ROOT_PASSWORD=root diff --git a/docker/docker-compose.ci.postgresql.yml b/docker/docker-compose.ci.postgresql.yml new file mode 100644 index 0000000..658fdbc --- /dev/null +++ b/docker/docker-compose.ci.postgresql.yml @@ -0,0 +1,41 @@ +# +# Copyright 2020-2022 Equinix, Inc +# Copyright 2014-2022 The Billing Project, LLC +# +# The Billing Project licenses this file to you 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: +# +# http://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. +# + +version: '3.8' + +services: + killbill: + network_mode: host + image: killbill/killbill:0.23.0-9116fa4-SNAPSHOT + environment: + - KILLBILL_CATALOG_URI=SpyCarAdvanced.xml + - KILLBILL_DAO_URL=jdbc:postgresql://127.0.0.1:5432/killbill + - KILLBILL_DAO_USER=postgres + - KILLBILL_DAO_PASSWORD=postgres + - KILLBILL_SERVER_TEST_MODE=true + - KILLBILL_INVOICE_SANITY_SAFETY_BOUND_ENABLED=false + - KILLBILL_INVOICE_MAX_DAILY_NUMBER_OF_ITEMS_SAFETY_BOUND=-1 + depends_on: + - db + volumes: + - /var/tmp/bundles/plugins/java/payment-test-plugin:/var/lib/killbill/bundles/plugins/java/payment-test-plugin + - /var/tmp/tomcat_logs:/var/lib/tomcat/logs + db: + network_mode: host + image: killbill/postgresql:0.23 + environment: + - POSTGRES_PASSWORD=postgres diff --git a/pom.xml b/pom.xml index ea55e24..1400837 100644 --- a/pom.xml +++ b/pom.xml @@ -14,16 +14,17 @@ ~ License for the specific language governing permissions and limitations ~ under the License. --> - + 4.0.0 org.kill-bill.billing killbill-oss-parent - 0.144.58 + 0.145.3-6e4b9ef-SNAPSHOT org.kill-bill.billing.plugin.java payment-test-plugin - 7.0.5-SNAPSHOT + 8.0.0-SNAPSHOT bundle Kill Bill Payment Test plugin Kill Bill Payment Test plugin @@ -40,8 +41,8 @@ true spotbugs-exclude.xml + 5.0.0-14752c2-SNAPSHOT org.killbill.billing.plugin.payment.* - 1.7.36 @@ -61,14 +62,24 @@ guava - javax.inject - javax.inject + io.airlift + testing-mysql-server + test - javax.servlet - javax.servlet-api + io.airlift + testing-postgresql-server + test + + + jakarta.servlet + jakarta.servlet-api provided + + javax.inject + javax.inject + joda-time joda-time @@ -77,6 +88,7 @@ org.apache.felix org.apache.felix.framework + provided org.jooby @@ -85,8 +97,13 @@ org.jooq jooq - - 3.13.5 + + + + org.slf4j + slf4j-api + + org.kill-bill.billing @@ -101,35 +118,31 @@ org.kill-bill.billing killbill-platform-osgi-bundles-lib-killbill + provided org.kill-bill.billing killbill-platform-test test - - - org.osgi - org.osgi.core - - + + + org.kill-bill.billing.plugin + killbill-plugin-api-control + provided + + + org.kill-bill.billing.plugin + killbill-plugin-api-notification + provided org.kill-bill.billing.plugin killbill-plugin-api-payment + provided org.kill-bill.billing.plugin.java killbill-base-plugin - - - org.osgi - org.osgi.core - - - org.reactivestreams - reactive-streams - - org.kill-bill.billing.plugin.java @@ -141,11 +154,22 @@ org.kill-bill.commons killbill-clock + + org.kill-bill.commons + killbill-clock + test-jar + test + org.kill-bill.commons killbill-embeddeddb-common test + + org.kill-bill.commons + killbill-metrics-api + provided + org.mockito mockito-core @@ -156,6 +180,11 @@ slf4j-api provided + + org.slf4j + slf4j-simple + test + org.testng testng @@ -164,43 +193,10 @@ - - com.ning.maven.plugins - maven-dependency-versions-check-plugin - - - - org.jooq - jooq - 3.14.13 - 3.13.5 - - - org.reactivestreams - reactive-streams - 1.0.3 - 1.0.2 - - - - org.apache.felix maven-bundle-plugin - - org.apache.maven.plugins - maven-enforcer-plugin - - - - - org.jooq:jooq - - - - - diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml index 56248a4..94b4813 100644 --- a/spotbugs-exclude.xml +++ b/spotbugs-exclude.xml @@ -19,4 +19,7 @@ + + + diff --git a/src/main/resources/ddl-postgresql.sql b/src/main/resources/ddl-postgresql.sql new file mode 100644 index 0000000..62690a0 --- /dev/null +++ b/src/main/resources/ddl-postgresql.sql @@ -0,0 +1,21 @@ +/* + * Copyright 2020-2021 Equinix, Inc + * Copyright 2014-2021 The Billing Project, LLC + * + * The Billing Project licenses this file to you 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: + * + * http://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. + */ + +/* We cannot use timestamp in MySQL because of the implicit TimeZone conversions it does behind the scenes */ +CREATE DOMAIN datetime AS timestamp without time zone; + +CREATE DOMAIN longtext AS text; diff --git a/src/main/resources/ddl.sql b/src/main/resources/ddl.sql index 803a8be..5bf9514 100644 --- a/src/main/resources/ddl.sql +++ b/src/main/resources/ddl.sql @@ -17,7 +17,7 @@ create index testpayment_hpp_requests_kb_payment_transaction_id on testpayment_h create table testpayment_responses ( record_id serial -, status char(10)not null +, status varchar(10)not null , kb_account_id char(36) not null , kb_payment_id char(36) not null , kb_payment_transaction_id char(36) not null diff --git a/src/test/java/org/killbill/billing/plugin/payment/EmbeddedDbHelper.java b/src/test/java/org/killbill/billing/plugin/payment/EmbeddedDbHelper.java index 0b21f5d..37cef68 100644 --- a/src/test/java/org/killbill/billing/plugin/payment/EmbeddedDbHelper.java +++ b/src/test/java/org/killbill/billing/plugin/payment/EmbeddedDbHelper.java @@ -36,6 +36,9 @@ public static EmbeddedDbHelper instance() { } public void startDb() throws Exception { + System.setProperty("org.jooq.no-logo", "true"); + System.setProperty("org.jooq.no-tips", "true"); + this.embeddedDB = PlatformDBTestingHelper.get().getInstance(); this.embeddedDB.initialize(); this.embeddedDB.start(); From 82cbe8b4f609b6b74a1d7e9fb8a7e8b468591f3b Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Meyer Date: Thu, 9 Jun 2022 10:05:30 +0100 Subject: [PATCH 2/3] .github: update ci job Signed-off-by: Pierre-Alexandre Meyer --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e2d9b..e8c9fc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,6 @@ jobs: uses: killbill/gh-actions-shared/.github/workflows/integration_test.yml@main with: plugin_name: 'payment-test' - integration_tests_goal: 'ci:payment-test' + integration_tests_goal: 'test:plugins:payment-test' ddl_file: 'src/main/resources/ddl.sql' - integration_tests_ref: 'refs/heads/integration-tests' + integration_tests_ref: 'refs/heads/work-for-release-0.23.x' From 56f4c6c94c405c431c4b1ab1905c05b8e3f133e7 Mon Sep 17 00:00:00 2001 From: Reshma Bidikar <85998496+reshmabidikar@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:00:58 +0530 Subject: [PATCH 3/3] Merged latest from master --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2db40b1..1e9a26f 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ dependency-reduced-pom.xml pom.xml.releaseBackup release.properties +/.project