forked from ringcentral/pubnub-jtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6968c99
commit 04a77db
Showing
11 changed files
with
116 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: run_acceptance_tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Perform Acceptance BDD tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
- name: Checkout mock-server action | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: pubnub/client-engineering-deployment-tools | ||
ref: github-actions | ||
token: ${{ secrets.GH_TOKEN }} | ||
path: client-engineering-deployment-tools | ||
- name: Run mock server action | ||
uses: ./client-engineering-deployment-tools/actions/mock-server | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
- name: Run acceptance tests | ||
run: | | ||
export pubKey=somePubKey | ||
export subKey=someSubKey | ||
export pamPubKey=somePamPubKey | ||
export pamSubKey=somePamSubKey | ||
export pamSecKey=someSecKey | ||
export featuresDir=sdk-specifications/features/access | ||
export cucumberTags=@feature=access | ||
export serverHostPort=localhost:8090 | ||
export serverMock=true | ||
./gradlew cucumber | ||
- name: Expose acceptance tests reports | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: acceptance-test-reports | ||
path: ./build/reports/cucumber-reports | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/test/java/com/pubnub/api/managers/token_manager/TokenParserTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.pubnub.api.managers.token_manager; | ||
|
||
import com.pubnub.api.PubNubException; | ||
import com.pubnub.api.models.consumer.access_manager.v3.PNToken; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
import java.util.Map; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class TokenParserTest { | ||
|
||
@Test | ||
public void parseTokenWithMeta() throws PubNubException { | ||
String tokenWithMeta = "qEF2AkF0GmFLd-NDdHRsGQWgQ3Jlc6VEY2hhbqFjY2gxGP9DZ3JwoWNjZzEY_0N1c3KgQ3NwY6BEdXVpZKFldXVpZDEY_0NwYXSlRGNoYW6gQ2dycKBDdXNyoENzcGOgRHV1aWShYl4kAURtZXRho2VzY29yZRhkZWNvbG9yY3JlZGZhdXRob3JlcGFuZHVEdXVpZGtteWF1dGh1dWlkMUNzaWdYIP2vlxHik0EPZwtgYxAW3-LsBaX_WgWdYvtAXpYbKll3"; | ||
PNToken parsed = new TokenParser().unwrapToken(tokenWithMeta); | ||
Assert.assertNotNull(parsed.getMeta()); | ||
assertFalse(((Map<?, ?>) parsed.getMeta()).isEmpty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters