Skip to content

Commit

Permalink
Add some spec references to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paddybyers committed Dec 13, 2018
1 parent 452c0aa commit f94e639
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/src/main/java/io/ably/lib/rest/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,10 @@ public TokenDetails requestToken(TokenParams params, AuthOptions tokenOptions) t
tokenOptions = (tokenOptions == null) ? this.authOptions : tokenOptions.copy();
params = (params == null) ? this.tokenParams : params.copy();

if(params.clientId == null)
/* Spec: RSA7d */
if(params.clientId == null) {
params.clientId = ably.clientId;
}
params.capability = Capability.c14n(params.capability);

/* get the signed token request */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void auth_client_match_token_null_clientId() {
/**
* Init library with a key and token; verify Auth.clientId is null before
* connection
* Spec: RSA12b, RSA7b2, RSA7b3
* Spec: RSA12b, RSA7b2, RSA7b3, RTC4a
*/
@Test
public void auth_clientid_null_before_auth() {
Expand Down Expand Up @@ -493,7 +493,7 @@ public void auth_client_match_token_clientId_fail() {
/**
* Verify message does not have explicit client id populated
* when library is identified
* Spec: RTL6g1a,RTL6g1b,RTL6g2,RTL6g3
* Spec: RTL6g1a,RTL6g1b,RTL6g2,RTL6g3,RSA7e1
*/
@Test
public void auth_clientid_publish_implicit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class RealtimeRecoverTest extends ParameterizedTest {
* and explicitly wait for the connection before re-attaching the channel.
* verify that the messages sent whilst disconnected are delivered
* on recover
* Spec: RTN16a,RTN16b
*/
@Test
public void recover_disconnected() {
Expand Down Expand Up @@ -135,6 +136,7 @@ public void recover_disconnected() {
* without an explicit wait for connection.
* verify that the messages sent whilst disconnected are delivered
* on recover
* Spec: RTN16a,RTN16b
*/
@Test
public void recover_implicit_connect() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void setupClient() throws Exception {
/**
* Stores the AuthOptions and TokenParams arguments as defaults for subsequent authorizations
* <p>
* Spec: RSA10g
* Spec: RSA10g,RSA10j
* </p>
*/
@Test
Expand Down
7 changes: 4 additions & 3 deletions lib/src/test/java/io/ably/lib/test/rest/RestAuthTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ public Object getTokenRequest(TokenParams params) throws AblyException {
/**
* Verify message does not have explicit client id populated
* when library is identified
* Spec: RSA7a1
* Spec: RSA7a1,RSL1g1a
*/
@Test
public void auth_clientid_publish_implicit() {
Expand Down Expand Up @@ -1537,7 +1537,7 @@ public void auth_clientid_basic_null_wildcard() {
/**
* Verify client id in token is populated from defaultTokenParams
* when library is initialised without explicit clientId
* Spec: RSA7a4
* Spec: RSA7a4, RSA7d
*/
@Test
public void auth_clientid_in_defaultparams() {
Expand Down Expand Up @@ -1565,7 +1565,7 @@ public void auth_clientid_in_defaultparams() {
/**
* Verify client id in token populated from ClientOptions
* overriding any clientId in defaultTokenParams
* Spec: RSA7a4
* Spec: RSA7a4, RSA7d
*/
@Test
public void auth_clientid_in_opts_overrides_defaultparams() {
Expand Down Expand Up @@ -1622,6 +1622,7 @@ public void auth_useTokenAuth() {
/**
* Test behaviour of queryTime parameter in ClientOpts. Time is requested from the Ably server only once,
* cached value should be used afterwards
* Spec: RSA9a
*/
@Test
public void auth_testQueryTime() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class RestChannelTest {
/**
* Test if ably.channel.get() returns same object if the same name is given
* Tests RTN2, RTN3
* Tests RTN2, RTN3, RSN3a, RSN4a
*/
@Test
public void channel_object_caching() throws AblyException {
Expand Down

0 comments on commit f94e639

Please sign in to comment.