Search in sources :

Example 11 with ToString

use of uk.gov.gchq.koryphe.impl.function.ToString in project Gaffer by gchq.

the class ObjectMapperProviderTest method shouldResolveShortClassNames.

@Test
public void shouldResolveShortClassNames() throws IOException {
    // When
    ObjectMapper objectMapper = new ObjectMapperProvider().getObjectMapper();
    String json = "{" + "\"class\": \"ToString\"" + "}";
    // Then
    Object deserialised = objectMapper.readValue(json, KorypheFunction.class);
    assertEquals(ToString.class, deserialised.getClass());
}
Also used : ToString(uk.gov.gchq.koryphe.impl.function.ToString) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.jupiter.api.Test)

Aggregations

ToString (uk.gov.gchq.koryphe.impl.function.ToString)11 Test (org.junit.jupiter.api.Test)8 Map (uk.gov.gchq.gaffer.operation.impl.Map)3 FunctionTest (uk.gov.gchq.koryphe.function.FunctionTest)3 FunctionComposite (uk.gov.gchq.koryphe.function.FunctionComposite)2 IterableFunction (uk.gov.gchq.koryphe.impl.function.IterableFunction)2 Length (uk.gov.gchq.koryphe.impl.function.Length)2 TupleAdaptedFunctionComposite (uk.gov.gchq.koryphe.tuple.function.TupleAdaptedFunctionComposite)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 Function (java.util.function.Function)1 LineIterator (org.apache.commons.io.LineIterator)1 Test (org.junit.Test)1 Element (uk.gov.gchq.gaffer.data.element.Element)1 Properties (uk.gov.gchq.gaffer.data.element.Properties)1 ElementTupleDefinition (uk.gov.gchq.gaffer.data.element.function.ElementTupleDefinition)1