Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/src/main/java/io/ably/lib/transport/Defaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
import java.util.Locale;

public class Defaults {
/* versions */
public static final float ABLY_VERSION_NUMBER = 1.1f;
public static final float ABLY_VERSION_NUMBER = 1.0f;

/**
* The level of compatibility with the Ably service that this SDK supports, also referred to as the 'wire protocol version'.
* This value is presented as a string, as specified in G4a.
*/
public static final String ABLY_VERSION = new DecimalFormat("0.0", new DecimalFormatSymbols(Locale.ENGLISH)).format(ABLY_VERSION_NUMBER);

public static final String ABLY_AGENT_VERSION = String.format("%s/%s", "ably-java", BuildConfig.VERSION);

/* params */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void realtime_websocket_param_test() {
* Defaults.ABLY_VERSION_PARAM, as ultimately the request param has been derived from those values.
*/
assertEquals("Verify correct version", requestParameters.get("v"),
Collections.singletonList("1.1"));
Collections.singletonList("1.0"));

/* Spec RSC7d3
* This test should not directly validate version against Defaults.ABLY_AGENT_VERSION, nor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void header_lib_channel_publish() {
* from those values.
*/
Assert.assertNotNull("Expected headers", headers);
Assert.assertEquals(headers.get("x-ably-version"), "1.1");
Assert.assertEquals(headers.get("x-ably-version"), "1.0");
Assert.assertEquals(headers.get("ably-agent"), expectedAblyAgentHeader);
} catch (AblyException e) {
e.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/test/java/io/ably/lib/transport/DefaultsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class DefaultsTest {

@Test
public void versions() {
assertThat(Defaults.ABLY_VERSION, is("1.1"));
assertThat(Defaults.ABLY_VERSION, is("1.0"));
}

@Test
Expand Down