@@ -0,0 +1,3186 @@
+package org.openmhealth.shim.misfit.mapper;%0A%0Aimport com.fasterxml.jackson.databind.JsonNode;%0Aimport org.openmhealth.schema.domain.omh.*;%0Aimport org.openmhealth.shim.common.mapper.DataPointMapperUnitTests;%0Aimport org.springframework.core.io.ClassPathResource;%0Aimport org.testng.annotations.BeforeTest;%0Aimport org.testng.annotations.Test;%0A%0Aimport java.io.IOException;%0Aimport java.time.OffsetDateTime;%0Aimport java.time.ZoneOffset;%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Aimport static org.hamcrest.CoreMatchers.equalTo;%0Aimport static org.hamcrest.CoreMatchers.notNullValue;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.greaterThan;%0Aimport static org.openmhealth.schema.domain.omh.DurationUnit.SECOND;%0Aimport static org.openmhealth.schema.domain.omh.LengthUnit.MILE;%0Aimport static org.openmhealth.shim.misfit.mapper.MisfitDataPointMapper.RESOURCE_API_SOURCE_NAME;%0A%0A%0A/**%0A * @author Emerson Farrugia%0A */%0Apublic class MisfitPhysicalActivityDataPointMapperUnitTests extends DataPointMapperUnitTests %7B%0A%0A    private final MisfitPhysicalActivityDataPointMapper mapper = new MisfitPhysicalActivityDataPointMapper();%0A%0A    private JsonNode responseNode;%0A%0A    @BeforeTest%0A    public void initializeResponseNode() throws IOException %7B%0A%0A        ClassPathResource resource = new ClassPathResource(%22org/openmhealth/shim/misfit/sessions.json%22);%0A        responseNode = objectMapper.readTree(resource.getInputStream());%0A    %7D%0A%0A    @Test%0A    public void asDataPointsShouldReturnCorrectNumberOfDataPoints() %7B%0A%0A        List%3CDataPoint%3CPhysicalActivity%3E%3E dataPoints = mapper.asDataPoints(Collections.singletonList(responseNode));%0A%0A        assertThat(dataPoints, notNullValue());%0A        assertThat(dataPoints.size(), equalTo(3));%0A    %7D%0A%0A    @Test%0A    public void asDataPointsShouldReturnCorrectDataPoints() %7B%0A%0A        List%3CDataPoint%3CPhysicalActivity%3E%3E dataPoints = mapper.asDataPoints(Collections.singletonList(responseNode));%0A%0A        assertThat(dataPoints, notNullValue());%0A        assertThat(dataPoints.size(), greaterThan(0));%0A%0A        TimeInterval effectiveTimeInterval = TimeInterval.ofStartDateTimeAndDuration(%0A                OffsetDateTime.of(2015, 4, 13, 11, 46, 0, 0, ZoneOffset.ofHours(-7)),%0A                new DurationUnitValue(SECOND, 1140.0));%0A%0A        PhysicalActivity physicalActivity = new PhysicalActivity.Builder(%22Walking%22)%0A                .setDistance(new LengthUnitValue(MILE, 0.9371))%0A                .setEffectiveTimeFrame(effectiveTimeInterval)%0A                .build();%0A%0A        DataPoint%3CPhysicalActivity%3E dataPoint = dataPoints.get(0);%0A%0A        assertThat(dataPoint.getBody(), equalTo(physicalActivity));%0A%0A        DataPointAcquisitionProvenance acquisitionProvenance = dataPoint.getHeader().getAcquisitionProvenance();%0A%0A        assertThat(acquisitionProvenance, notNullValue());%0A        assertThat(acquisitionProvenance.getSourceName(), equalTo(RESOURCE_API_SOURCE_NAME));%0A        assertThat(acquisitionProvenance.getAdditionalProperty(%22external_id%22).isPresent(), equalTo(true));%0A        assertThat(acquisitionProvenance.getAdditionalProperty(%22external_id%22).get(),%0A                equalTo(%22552eab896c59ae1f7300003e%22));%0A    %7D%0A%7D

Add Misfit physical activity mapper tests