GH-395 Add support for non-message json to be converted as POJO

Resolves #395
This commit is contained in:
Oleg Zhurakousky
2019-10-01 14:06:17 -04:00
parent 97bea81836
commit 52f1f04020
2 changed files with 19 additions and 1 deletions

View File

@@ -282,6 +282,16 @@ public class BeanFactoryAwareFunctionRegistryTests {
assertThat((Object) catalog.lookup("")).isNull();
}
@Test
public void pojoFunctionAsJson() {
FunctionCatalog catalog = this.configureCatalog();
Function<String, Person> uppercasePerson = catalog.lookup("uppercasePerson");
Person person = uppercasePerson.apply("{\"name\":\"bill\",\"id\":2}");
assertThat(person.getName()).isEqualTo("BILL");
}
@EnableAutoConfiguration
@Configuration