// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());


import org.testng.annotations.Test;
import java.math.BigDecimal;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.AVERAGE;
import static org.openmhealth.schema.domain.omh.HeartRateUnit.BEATS_PER_MINUTE;
import static org.openmhealth.schema.domain.omh.TemporalRelationshipToPhysicalActivity.AFTER_EXERCISE;
import static org.openmhealth.schema.domain.omh.TemporalRelationshipToPhysicalActivity.AT_REST;
import static org.openmhealth.schema.domain.omh.TemporalRelationshipToSleep.BEFORE_SLEEPING;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
        BigDecimal heartRateValue = BigDecimal.valueOf(60);

        HeartRate heartRate = new HeartRate.Builder(heartRateValue)
                .setTemporalRelationshipToPhysicalActivity(AFTER_EXERCISE)
                .setTemporalRelationshipToSleep(BEFORE_SLEEPING)
                .setEffectiveTimeFrame(FIXED_MONTH)
                .setDescriptiveStatistic(AVERAGE)
                .setUserNotes("feeling fine")
                .build();

        assertThat(heartRate, notNullValue());
        assertThat(heartRate.getHeartRate(), equalTo(new TypedUnitValue<>(BEATS_PER_MINUTE, heartRateValue)));
        assertThat(heartRate.getTemporalRelationshipToPhysicalActivity(), equalTo(AFTER_EXERCISE));
        assertThat(heartRate.getTemporalRelationshipToSleep(), equalTo(BEFORE_SLEEPING));
        assertThat(heartRate.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));
        assertThat(heartRate.getDescriptiveStatistic(), equalTo(AVERAGE));
        assertThat(heartRate.getUserNotes(), equalTo("feeling fine"));
    }

    @Override
    protected String getSchemaFilename() {
        return SCHEMA_FILENAME;
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        HeartRate heartRate = new HeartRate.Builder(BigDecimal.valueOf(50))
                .setTemporalRelationshipToPhysicalActivity(AT_REST)
                .setTemporalRelationshipToSleep(BEFORE_SLEEPING)
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_MONTH =
//         new TimeFrame(ofStartDateTimeAndEndDateTime(
//                 LocalDate.of(2015, OCTOBER, 1).atStartOfDay(PT).toOffsetDateTime(),
//                 LocalDate.of(2015, NOVEMBER, 1).atStartOfDay(PT).toOffsetDateTime()
//         ));
// 
// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/TimeFrameFactory.java
// public static final TimeFrame FIXED_POINT_IN_TIME =
//         new TimeFrame(ZonedDateTime.of(2015, OCTOBER.getValue(), 21, 16, 29, 0, 0, PT).toOffsetDateTime());


// Path: java-schema-sdk/src/test/java/org/openmhealth/schema/domain/omh/HeartRateUnitTests.java
import org.testng.annotations.Test;
import java.math.BigDecimal;
import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.AVERAGE;
import static org.openmhealth.schema.domain.omh.HeartRateUnit.BEATS_PER_MINUTE;
import static org.openmhealth.schema.domain.omh.TemporalRelationshipToPhysicalActivity.AFTER_EXERCISE;
import static org.openmhealth.schema.domain.omh.TemporalRelationshipToPhysicalActivity.AT_REST;
import static org.openmhealth.schema.domain.omh.TemporalRelationshipToSleep.BEFORE_SLEEPING;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;

        BigDecimal heartRateValue = BigDecimal.valueOf(60);

        HeartRate heartRate = new HeartRate.Builder(heartRateValue)
                .setTemporalRelationshipToPhysicalActivity(AFTER_EXERCISE)
                .setTemporalRelationshipToSleep(BEFORE_SLEEPING)
                .setEffectiveTimeFrame(FIXED_MONTH)
                .setDescriptiveStatistic(AVERAGE)
                .setUserNotes("feeling fine")
                .build();

        assertThat(heartRate, notNullValue());
        assertThat(heartRate.getHeartRate(), equalTo(new TypedUnitValue<>(BEATS_PER_MINUTE, heartRateValue)));
        assertThat(heartRate.getTemporalRelationshipToPhysicalActivity(), equalTo(AFTER_EXERCISE));
        assertThat(heartRate.getTemporalRelationshipToSleep(), equalTo(BEFORE_SLEEPING));
        assertThat(heartRate.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));
        assertThat(heartRate.getDescriptiveStatistic(), equalTo(AVERAGE));
        assertThat(heartRate.getUserNotes(), equalTo("feeling fine"));
    }

    @Override
    protected String getSchemaFilename() {
        return SCHEMA_FILENAME;
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        HeartRate heartRate = new HeartRate.Builder(BigDecimal.valueOf(50))
                .setTemporalRelationshipToPhysicalActivity(AT_REST)
                .setTemporalRelationshipToSleep(BEFORE_SLEEPING)
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)