Skip to content

Instantly share code, notes, and snippets.

@murat-kilic
Created September 30, 2019 16:14
Show Gist options
  • Save murat-kilic/723702e0ce51bd3609fccd6c417d7f98 to your computer and use it in GitHub Desktop.
Save murat-kilic/723702e0ce51bd3609fccd6c417d7f98 to your computer and use it in GitHub Desktop.
public void testExecuteFunction() {
assertTrue(client.addFunction("ExecuteMyFunction", "io.mark.java_examples.Executables.RunThisCode::addPerson"));
assertTrue(client.uploadFile("ExecuteMyFunction", "ExecutableCode-1.0-SNAPSHOT.jar"));
assertEquals(client.executeFunction("ExecuteMyFunction", "{\"firstName\":\"Mark\",\"lastName\":\"Kose\",\"age\":30,\"isActive\":false}"),"{\"fullName\":\"Mark Kose\",\"age\":30,\"shouldExerciseMore\":true}");
AddPersonResponse person=(AddPersonResponse)client.executeFunction("ExecuteMyFunction","{\"firstName\":\"Mark\",\"lastName\":\"Kose\",\"age\":30,\"isActive\":false}","java");
assertEquals(person.fullName,"Mark Kose");
assertTrue(person.shouldExerciseMore);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment