Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug TROPO-11296 tropo-webapi-java wait #44

Merged
merged 1 commit into from
May 5, 2017
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Additionally, this library implements the session method from Tropo [Rest API](h
Requirements
------------

Current version is 0.4.8.
Current version is 0.4.9.

License
------------
Expand Down Expand Up @@ -43,7 +43,7 @@ If you want to use the Maven artifact from your own projects you can add the fol
<dependency>
<groupId>com.voxeo.tropo</groupId>
<artifactId>tropo-webapi-java</artifactId>
<version>0.4.8</version>
<version>0.4.9</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.voxeo.tropo</groupId>
<artifactId>tropo-webapi-java</artifactId>
<version>0.4.9-SNAPSHOT</version>
<version>0.4.9</version>
<packaging>jar</packaging>
<name>Tropo Java WebApi</name>
<description>WebApi Java implementation for the Tropo Cloud platform</description>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/voxeo/tropo/Tropo.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public void render(HttpServletResponse response, String json) {
try {
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
response.addHeader("Webapi client lang", "java");

response.getWriter().write(text());
response.getWriter().flush();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/voxeo/tropo/actions/WaitAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.voxeo.tropo.annotations.RequiredKeys;
import com.voxeo.tropo.annotations.ValidKeys;

@ValidKeys(keys={"milliseconds"})
@ValidKeys(keys={"allowSignals", "milliseconds"})
@RequiredKeys(keys={"milliseconds"})
public class WaitAction extends JsonAction {

Expand Down
19 changes: 19 additions & 0 deletions src/test/java/com/voxeo/tropo/WaitActionTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.voxeo.tropo;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class WaitActionTest {

@Test
public void testWait() {

Tropo tropo = new Tropo();
tropo.say("Connected!", "connected");
tropo.serverWait(Key.ALLOW_SIGNALS("exit", "quit"), Key.MILLISECONDS(10000L));
tropo.say("Bye!", "bye");

assertEquals(tropo.text(), "{\"tropo\":[{\"say\":[{\"value\":\"Connected!\",\"name\":\"connected\"}]},{\"wait\":{\"allowSignals\":[\"exit\",\"quit\"],\"milliseconds\":10000}},{\"say\":[{\"value\":\"Bye!\",\"name\":\"bye\"}]}]}");
}
}