Skip to content

Commit

Permalink
PubNub SDK v5.2.1 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed Oct 6, 2021
1 parent 6968c99 commit 04a77db
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 24 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/run_acceptance_tests.yml
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

16 changes: 12 additions & 4 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: java
version: 5.2.0
version: 5.2.1
schema: 1
scm: github.com/pubnub/java
files:
- build/libs/pubnub-gson-5.2.0-all.jar
- build/libs/pubnub-gson-5.2.1-all.jar
sdks:
-
type: library
Expand Down Expand Up @@ -234,6 +234,13 @@ sdks:
is-required: Required

changelog:
- version: v5.2.1
date: 2021-10-06
changes:
- type: feature
text: "Acceptance tests plugged into CI pipeline."
- type: bug
text: "Meta field exposed correctly in PNToken class."
- version: v5.2.0
date: 2021-09-08
changes:
Expand Down Expand Up @@ -748,8 +755,9 @@ features:
- ACCESS-GRANT-MANAGE
- ACCESS-GRANT-DELETE
- ACCESS-SECRET-KEY-ALL-ACCESS
- ACCESS-GRANT-V3
- ACCESS-TOKEN-MANAGEMENT
- ACCESS-GRANT-TOKEN
- ACCESS-PARSE-TOKEN
- ACCESS-SET-TOKEN
channel-groups:
- CHANNEL-GROUPS-ADD-CHANNELS
- CHANNEL-GROUPS-REMOVE-CHANNELS
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
## [v5.2.1](https://github.com/pubnub/java/releases/tag/v5.2.1)
October-06-2021

[Full Changelog](https://github.com/pubnub/java/compare/v5.2.0...v5.2.1)

- 🌟️ Acceptance tests plugged into CI pipeline.
- 🐛 Meta field exposed correctly in PNToken class.

## [v5.2.0](https://github.com/pubnub/java/releases/tag/v5.2.0)
September-08-2021

[Full Changelog](https://github.com/pubnub/java/compare/v5.1.1...v5.2.0)

- 🌟️ Extend grantToken method to enable control of Objects API permission. Enhance granularity of permission control to enable permissions per UUID.

## [v5.1.1](https://github.com/pubnub/java/releases/tag/v5.1.1)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ You will need the publish and subscribe keys to authenticate your app. Get your
<dependency>
<groupId>com.pubnub</groupId>
<artifactId>pubnub-gson</artifactId>
<version>5.2.0</version>
<version>5.2.1</version>
</dependency>
```

* for Gradle, add the following dependency in your `gradle.build`:
```groovy
compile group: 'com.pubnub', name: 'pubnub-gson', version: '5.2.0'
compile group: 'com.pubnub', name: 'pubnub-gson', version: '5.2.1'
```

2. Configure your keys:
Expand Down
27 changes: 21 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}
group = 'com.pubnub'

version = '5.2.0'
version = '5.2.1'

description = """"""

Expand All @@ -34,16 +34,31 @@ task cucumber() {
group = "verification"
doLast {
javaexec {
def localProperties = new Properties()
localProperties.load(new FileInputStream(rootProject.file("test.properties")))

Properties localProperties = new Properties()
try {
localProperties.load(new FileInputStream(rootProject.file("test.properties")))
}
catch (Exception e) {
localProperties.putAll(System.getenv())
}
main = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output

if (localProperties['cucumber.tags'] != null) {
args = ['--tags', localProperties['cucumber.tags'], '--plugin', 'pretty', '--glue', 'com.pubnub.contract', localProperties['features.dir']]
args = ['--tags', localProperties['cucumberTags'],
'--plugin', 'pretty',
'--plugin', 'json:build/reports/cucumber-reports/Cucumber.json',
'--plugin', 'junit:build/reports/cucumber-reports/Cucumber.xml',
'--plugin', 'html:build/reports/cucumber-reports/Cucumber.html',
'--glue', 'com.pubnub.contract',
localProperties['featuresDir']]
} else {
args = ['--plugin', 'pretty', '--glue', 'com.pubnub.contract', localProperties['features.dir']]
args = ['--plugin', 'pretty',
'--plugin', 'json:build/reports/cucumber-reports/Cucumber.json',
'--plugin', 'junit:build/reports/cucumber-reports/Cucumber.xml',
'--plugin', 'html:build/reports/cucumber-reports/Cucumber.html',
'--glue', 'com.pubnub.contract',
localProperties['featuresDir']]
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pubnub/api/PubNub.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class PubNub {
private static final int TIMESTAMP_DIVIDER = 1000;
private static final int MAX_SEQUENCE = 65535;

private static final String SDK_VERSION = "5.2.0";
private static final String SDK_VERSION = "5.2.1";
private final ListenerManager listenerManager;
private final StateManager stateManager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class PNToken {
private final long timestamp;
private final long ttl;
private final String authorizedUUID;
private final Object meta;
@NonNull
private final PNTokenResources resources;
@NonNull
Expand All @@ -28,8 +29,9 @@ public static PNToken of(
@JsonProperty("ttl") final long ttl,
@JsonProperty("res") final PNTokenResources res,
@JsonProperty("pat") final PNTokenResources pat,
@JsonProperty("uuid") final String uuid) {
return new PNToken(v, t, ttl, uuid, res, pat);
@JsonProperty("uuid") final String uuid,
@JsonProperty("meta") final Object meta) {
return new PNToken(v, t, ttl, uuid, meta, res, pat);
}

@Data
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/pubnub/api/PubNubTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void getVersionAndTimeStamp() {
pubnub = new PubNub(pnConfiguration);
String version = pubnub.getVersion();
int timeStamp = pubnub.getTimestamp();
Assert.assertEquals("5.2.0", version);
Assert.assertEquals("5.2.1", version);
Assert.assertTrue(timeStamp > 0);
}

Expand Down
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());
}
}
4 changes: 2 additions & 2 deletions src/test/java/com/pubnub/contract/ContractTestConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ interface ContractTestConfig : Config {
@Config.Key("pamSecKey")
fun pamSecKey(): String?

@Config.Key("server.hostPort")
@Config.Key("serverHostPort")
fun serverHostPort(): String

@Config.Key("server.mock")
@Config.Key("serverMock")
fun serverMock(): Boolean
}

Expand Down
8 changes: 4 additions & 4 deletions test.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ subKey: <<PASTE_SUBSCRIBE_KEY_HERE>>
pamPubKey: <<PASTE_PAM_PUBLISH_KEY_HERE>>
pamSubKey: <<PASTE_PAM_SUBSCRIBE_KEY_HERE>>
pamSecKey: <<PASTE_PAM_SECRET_KEY_HERE>>
features.dir: <<PATH TO FEATURES>>
cucumber.tags: <<TAG FILTER>>
server.hostPort: localhost:8090
featuresDir: <<PATH TO FEATURES>>
cucumberTags: <<TAG FILTER>>
serverHostPort: localhost:8090
#server.hostPort: ps.pndsn.com
server.mock: true
serverMock: true

0 comments on commit 04a77db

Please sign in to comment.