Skip to content

Commit 950a903

Browse files
committed
Fix failing tests and increment version to 2.0.0-SNAPSHOT
1 parent ae2e34e commit 950a903

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ build
1212
.idea
1313

1414
*.iml
15-
gradle.properties
15+
gradle.properties
16+
local.properties

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ apply plugin: 'org.ajoberstar.github-pages'
2121
apply plugin: 'signing'
2222

2323
group = "com.pusher"
24-
version = "1.4.0"
24+
version = "2.0.0-SNAPSHOT"
2525
sourceCompatibility = "1.6"
2626
targetCompatibility = "1.6"
2727

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Nov 15 11:59:30 GMT 2016
1+
#Fri Feb 24 10:18:34 GMT 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

src/test/java/com/pusher/client/channel/impl/PrivateChannelImplTest.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void testTriggerWithValidEventSendsMessage() {
110110
verify(mockConnection)
111111
.sendMessage(
112112
"{\"event\":\"client-myEvent\",\"channel\":\"" + getChannelName()
113-
+ "\",\"data\":{\"fish\":\"chips\"}}");
113+
+ "\",\"data\":\"{\\\"fish\\\":\\\"chips\\\"}\"}");
114114
}
115115

116116
@Test(expected = IllegalArgumentException.class)
@@ -129,20 +129,16 @@ public void testTriggerWithInvalidEventNameThrowsException() {
129129
((PrivateChannelImpl)channel).trigger("myEvent", "{\"fish\":\"chips\"}");
130130
}
131131

132-
@Test(expected = IllegalArgumentException.class)
133-
public void testTriggerWithInvalidJSONThrowsException() {
134-
when(mockConnection.getState()).thenReturn(ConnectionState.CONNECTED);
135-
channel.updateState(ChannelState.SUBSCRIBED);
136-
137-
((PrivateChannelImpl)channel).trigger("client-myEvent", "{\"fish\":malformed");
138-
}
139-
140-
@Test(expected = IllegalArgumentException.class)
141-
public void testTriggerWithJSONStringInsteadOfObjectThrowsException() {
132+
@Test
133+
public void testTriggerWithString() {
142134
when(mockConnection.getState()).thenReturn(ConnectionState.CONNECTED);
143135
channel.updateState(ChannelState.SUBSCRIBED);
144136

145137
((PrivateChannelImpl)channel).trigger("client-myEvent", "string");
138+
139+
verify(mockConnection).sendMessage(
140+
"{\"event\":\"client-myEvent\",\"channel\":\"" + getChannelName()
141+
+ "\",\"data\":\"string\"}");
146142
}
147143

148144
@Test(expected = IllegalStateException.class)

0 commit comments

Comments
 (0)