diff --git a/.cfconfig.json b/.cfconfig.json new file mode 100644 index 0000000..8d62e40 --- /dev/null +++ b/.cfconfig.json @@ -0,0 +1,38 @@ +{ + "adminPassword" : "coldbox", + "componentCacheEnabled":false, + "postParametersLimit" : 200, + "robustExceptionEnabled":true, + "saveClassFiles":false, + "systemErr":"System", + "systemOut":"System", + "thistimezone":"UTC", + "whitespaceManagement":"white-space-pref", + "debuggingEnabled":true, + "debuggingReportExecutionTimes":false, + "disableInternalCFJavaComponents":false, + "inspectTemplate":"always", + "requestTimeout":"0,0,0,90", + "datasources":{ + "twilio-sdk":{ + "bundleName": "${DB_BUNDLENAME}", + "bundleVersion": "${DB_BUNDLEVERSION}", + "blob":"true", + "class":"${DB_CLASS}", + "clob":"true", + "connectionLimit":"100", + "connectionTimeout":"1", + "custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true", + "database":"twilio-sdk", + "dbdriver":"MySQL", + "dsn":"jdbc:mysql://{host}:{port}/{database}", + "host":"${DB_HOST:127.0.0.1}", + "metaCacheTimeout":"60000", + "password":"${DB_PASSWORD}", + "port": "${DB_PORT:3306}", + "storage":"false", + "username": "${DB_USER:root}", + "validate":"false" + } + } +} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 988a4a0..17146fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,10 +22,17 @@ jobs: env: DB_USER: root DB_PASSWORD: root + continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: cfengine: [ "lucee@5", "lucee@6", "adobe@2021", "adobe@2023" ] + coldboxVersion: [ "^6.0.0", "^7.0.0"] + experimental: [ false ] + include: + - coldboxVersion: "be" + cfengine: "boxlang@1" + experimental: true steps: - name: Checkout Repository uses: actions/checkout@v2 @@ -73,6 +80,7 @@ jobs: - name: Install Test Harness Dependencies run: | + box package set dependencies.coldbox=${{ matrix.coldboxVersion }} box install - name: Start ${{ matrix.cfengine }} Server @@ -82,12 +90,12 @@ jobs: TWILIO_TEST_ACCOUNT_SID: ${{ secrets.TWILIO_TEST_ACCOUNT_SID }} TWILIO_TEST_AUTHTOKEN: ${{ secrets.TWILIO_TEST_AUTHTOKEN }} run: | - box server start cfengine=${{ matrix.cfengine }} port=49619 --noSaveSettings --debug + box server start serverConfigFile=server-${{ matrix.cfengine }}.json --noSaveSettings --debug # Install Adobe 2021 cfpm modules if [[ "${{ matrix.cfengine }}" == "adobe@2021" ]] ; then box run-script install:2021 fi - curl http://127.0.0.1:49619 + curl http://127.0.0.1:60299 - name: Run Tests env: @@ -100,17 +108,17 @@ jobs: box testbox run --verbose outputFile=tests/results/test-results outputFormats=json,antjunit - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v1 + uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: - files: tests/results/**/*.xml - check_name: "${{ matrix.cfengine }} Test Results" + junit_files: tests/results/**/*.xml + check_name: "${{ matrix.cfengine }} ColdBox ${{ matrix.coldboxVersion }} Test Results" - name: Upload Test Results to Artifacts if: always() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4.4.3 with: - name: test-results-${{ matrix.cfengine }} + name: test-results-${{ matrix.cfengine }}-${{ matrix.coldboxVersion }} path: | tests/results/**/* @@ -121,9 +129,9 @@ jobs: - name: Upload Debug Logs To Artifacts if: ${{ failure() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4.4.3 with: - name: Failure Debugging Info - ${{ matrix.cfengine }} + name: Failure Debugging Info - ${{ matrix.cfengine }} - ${{ matrix.coldboxVersion }} path: | .engine/**/logs/* .engine/**/WEB-INF/cfusion/logs/* @@ -137,6 +145,6 @@ jobs: SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff' SLACK_ICON_EMOJI: ":bell:" SLACK_MESSAGE: '${{ github.repository }} tests failed :cry:' - SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed + SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} with ColdBox ${{ matrix.coldboxVersion }} failed SLACK_USERNAME: CI SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/models/TwilioClient.cfc b/models/TwilioClient.cfc index 27c1671..2bb921d 100644 --- a/models/TwilioClient.cfc +++ b/models/TwilioClient.cfc @@ -81,7 +81,7 @@ component singleton accessors="true" { function getSMS( required string sid ) { return newRequest() .setMethod( "GET" ) - .setUrl( "/Accounts/#variables.accountSID#/Messages/#arguments.sid#.json") + .setUrl( "/Accounts/#variables.accountSID#/Messages/#arguments.sid#.json" ) } /** diff --git a/server-adobe@2021.json b/server-adobe@2021.json new file mode 100644 index 0000000..3b5321d --- /dev/null +++ b/server-adobe@2021.json @@ -0,0 +1,29 @@ +{ + "name":"twilio-sdk-adobe@2021", + "app":{ + "serverHomeDirectory":".engine/adobe2021", + "cfengine":"adobe@2021" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot":"./", + "aliases":{ + "/moduleroot/twilio-sdk":"./" + } + }, + "jvm":{ + "heapSize":"1024" + }, + "openBrowser":"false", + "cfconfig":{ + "file":".cfconfig.json" + }, + "scripts":{ + "onServerInstall":"cfpm install zip,debugger,mysql" + } +} diff --git a/server-adobe@2023.json b/server-adobe@2023.json new file mode 100644 index 0000000..fb1a0c8 --- /dev/null +++ b/server-adobe@2023.json @@ -0,0 +1,29 @@ +{ + "name":"twilio-sdk-adobe@2023", + "app":{ + "serverHomeDirectory":".engine/adobe2023", + "cfengine":"adobe@2023" + }, + "web":{ + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":"true" + }, + "webroot":"./", + "aliases":{ + "/moduleroot/twilio-sdk":"./" + } + }, + "jvm":{ + "heapSize":"1024" + }, + "openBrowser":"false", + "cfconfig":{ + "file":".cfconfig.json" + }, + "scripts":{ + "onServerInstall":"cfpm install zip,debugger,mysql" + } +} diff --git a/server-boxlang@1.json b/server-boxlang@1.json new file mode 100644 index 0000000..158adbb --- /dev/null +++ b/server-boxlang@1.json @@ -0,0 +1,36 @@ +{ + "app":{ + "cfengine":"boxlang@be", + "serverHomeDirectory":".engine/boxlang" + }, + "name":"twilio-sdk-boxlang@1", + "force":true, + "openBrowser":false, + "web":{ + "directoryBrowsing":true, + "http":{ + "port":"60299" + }, + "rewrites":{ + "enable":true + }, + "webroot":".", + "aliases":{ + "/moduleroot/twilio-sdk":"./" + } + }, + "JVM":{ + "heapSize":"1024", + "javaVersion":"openjdk21_jdk", + "args":"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999" + }, + "cfconfig":{ + "file":".cfconfig.json" + }, + "env":{ + "BOXLANG_DEBUG":true + }, + "scripts":{ + "onServerInitialInstall":"install bx-mail,bx-mysql,bx-derby,bx-compat-cfml@be,bx-unsafe-evaluate,bx-esapi --noSave" + } +} \ No newline at end of file diff --git a/server-lucee@5.json b/server-lucee@5.json new file mode 100644 index 0000000..8e34d70 --- /dev/null +++ b/server-lucee@5.json @@ -0,0 +1,10 @@ +{ + "web":{ + "http":{ + "port":"60299" + } + }, + "app":{ + "cfengine":"lucee@5" + } +} \ No newline at end of file diff --git a/server-lucee@6.json b/server-lucee@6.json new file mode 100644 index 0000000..68ee2e5 --- /dev/null +++ b/server-lucee@6.json @@ -0,0 +1,10 @@ +{ + "web":{ + "http":{ + "port":"60299" + } + }, + "app":{ + "cfengine":"lucee@6" + } +} \ No newline at end of file diff --git a/tests/specs/unit/SignatureTest.cfc b/tests/specs/unit/SignatureTest.cfc index 75265a3..61b0929 100644 --- a/tests/specs/unit/SignatureTest.cfc +++ b/tests/specs/unit/SignatureTest.cfc @@ -14,7 +14,9 @@ component extends="testbox.system.BaseSpec" { "Digits": "1234" }; var expectedSignature = "GvWf1cFY/Q7PnoempGyD5oXAezc="; - expect( validator.validate( expectedSignature, uri, formParams ) ).toBeTrue( "Signature should have validated correctly" ); + expect( validator.validate( expectedSignature, uri, formParams ) ).toBeTrue( + "Signature should have validated correctly" + ); } ); it( "returns false for an invalid signature", function() { @@ -29,7 +31,9 @@ component extends="testbox.system.BaseSpec" { "Digits": "1234" }; var invalidSignature = "invalid"; - expect( validator.validate( invalidSignature, uri, formParams ) ).toBeFalse( "Signature should not have validated correctly" ); + expect( validator.validate( invalidSignature, uri, formParams ) ).toBeFalse( + "Signature should not have validated correctly" + ); } ); } ); }