Skip to content

Commit

Permalink
Migrating to STEP 3.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromecomte committed Jan 21, 2019
1 parent 1e2be69 commit 7182545
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion keywords/java/demo-java-keyword/pom.xml
Expand Up @@ -8,7 +8,7 @@
<artifactId>demo-java-keyword</artifactId>

<properties>
<step.version>3.7.2</step.version>
<step.version>3.9.0</step.version>
<junit.version>4.8.1</junit.version>
</properties>

Expand Down
Expand Up @@ -21,11 +21,13 @@
import java.util.HashMap;
import java.util.Map;

import javax.json.JsonObject;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

import step.grid.io.OutputMessage;
import step.functions.io.Output;
import step.handlers.javahandler.KeywordRunner;
import step.handlers.javahandler.KeywordRunner.ExecutionContext;

Expand All @@ -40,17 +42,17 @@ public void before() {
}

@Test
public void getTime() {
OutputMessage result = ctx.run("Current time", "{ \"format\" : \"ddMMyyyy\" }");
public void getTime() throws Exception {
Output<JsonObject> result = ctx.run("Current time", "{ \"format\" : \"ddMMyyyy\" }");
Assert.assertTrue(result.getPayload().containsKey("time"));
}

@Test
public void Demo_Keyword_Sequence() {
public void Demo_Keyword_Sequence() throws Exception {
Map<String, String> properties = new HashMap<>();
ExecutionContext ctx = KeywordRunner.getExecutionContext(properties, JavaKeywordExample.class);

OutputMessage result;
Output<JsonObject> result;
result = ctx.run("Set date format", "{ \"format\" : \"ddMMyyyy\" }");
result = ctx.run("Get time using previously defined format", "{}");

Expand Down

0 comments on commit 7182545

Please sign in to comment.