package org.openmhealth.shim.common.mapper;

import com.fasterxml.jackson.databind.ObjectMapper;

import static org.openmhealth.schema.configuration.JacksonConfiguration.newObjectMapper;


/**
 * @author Emerson Farrugia
 */
public abstract class DataPointMapperUnitTests {

    protected static final ObjectMapper objectMapper = newObjectMapper();
}

@@ -76,30 +76,228 @@
 atabind.
-ObjectMapper;%0A
+JsonNode;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport org.springframework.core.io.ClassPathResource;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0A%0Aimport static java.lang.String.format;
 %0Aimport 
@@ -540,10 +540,756 @@
 pper();%0A
+%0A%0A    /**%0A     * @param classPathResourceName the name of the class path resource to load%0A     * @return the contents of the resource as a %7B@link JsonNode%7D%0A     * @throws RuntimeException if the resource can't be loaded%0A     */%0A    protected JsonNode asJsonNode(String classPathResourceName) %7B%0A%0A        ClassPathResource resource = new ClassPathResource(classPathResourceName);%0A%0A        try %7B%0A            InputStream resourceInputStream = resource.getInputStream();%0A            return objectMapper.readTree(resourceInputStream);%0A        %7D%0A        catch (IOException e) %7B%0A            throw new RuntimeException(%0A                    format(%22The class path resource '%25s' can't be loaded as a JSON node.%22, classPathResourceName), e);%0A        %7D%0A    %7D%0A
 %7D%0A

Add unit test support to load class path resources as JSON nodes