// 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.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MEDIAN;
import static org.openmhealth.schema.domain.omh.TemperatureUnit.CELSIUS;
import static org.openmhealth.schema.domain.omh.TemperatureUnit.FAHRENHEIT;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;
        assertThat(ambientTemperature, notNullValue());
        assertThat(ambientTemperature.getAmbientTemperature().getTypedUnit(), equalTo(CELSIUS));
        assertThat(ambientTemperature.getAmbientTemperature().getValue().doubleValue(), equalTo(50.3));

        assertThat(ambientTemperature.getUserNotes(), nullValue());
        assertThat(ambientTemperature.getEffectiveTimeFrame(), nullValue());
        assertThat(ambientTemperature.getDescriptiveStatistic(), nullValue());
    }

    @Test
    public void buildShouldConstructCorrectMeasureIncludingOptionalProperties() {

        AmbientTemperature ambientTemperature =
                new AmbientTemperature.Builder(new TemperatureUnitValue(FAHRENHEIT, 87L))
                        .setDescriptiveStatistic(MEDIAN)
                        .setEffectiveTimeFrame(FIXED_MONTH)
                        .setUserNotes("Temp is fine")
                        .build();

        assertThat(ambientTemperature.getAmbientTemperature().getTypedUnit(), equalTo(FAHRENHEIT));
        assertThat(ambientTemperature.getAmbientTemperature().getValue().intValue(), equalTo(87));
        assertThat(ambientTemperature.getUserNotes(), equalTo("Temp is fine"));
        assertThat(ambientTemperature.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));
        assertThat(ambientTemperature.getDescriptiveStatistic(), equalTo(MEDIAN));
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        AmbientTemperature ambientTemperature = new AmbientTemperature.Builder(new TemperatureUnitValue(CELSIUS, 34L))
// 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/AmbientTemperatureUnitTests.java
import org.testng.annotations.Test;
import java.time.OffsetDateTime;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.openmhealth.schema.domain.omh.DescriptiveStatistic.MEDIAN;
import static org.openmhealth.schema.domain.omh.TemperatureUnit.CELSIUS;
import static org.openmhealth.schema.domain.omh.TemperatureUnit.FAHRENHEIT;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_MONTH;
import static org.openmhealth.schema.domain.omh.TimeFrameFactory.FIXED_POINT_IN_TIME;

        assertThat(ambientTemperature, notNullValue());
        assertThat(ambientTemperature.getAmbientTemperature().getTypedUnit(), equalTo(CELSIUS));
        assertThat(ambientTemperature.getAmbientTemperature().getValue().doubleValue(), equalTo(50.3));

        assertThat(ambientTemperature.getUserNotes(), nullValue());
        assertThat(ambientTemperature.getEffectiveTimeFrame(), nullValue());
        assertThat(ambientTemperature.getDescriptiveStatistic(), nullValue());
    }

    @Test
    public void buildShouldConstructCorrectMeasureIncludingOptionalProperties() {

        AmbientTemperature ambientTemperature =
                new AmbientTemperature.Builder(new TemperatureUnitValue(FAHRENHEIT, 87L))
                        .setDescriptiveStatistic(MEDIAN)
                        .setEffectiveTimeFrame(FIXED_MONTH)
                        .setUserNotes("Temp is fine")
                        .build();

        assertThat(ambientTemperature.getAmbientTemperature().getTypedUnit(), equalTo(FAHRENHEIT));
        assertThat(ambientTemperature.getAmbientTemperature().getValue().intValue(), equalTo(87));
        assertThat(ambientTemperature.getUserNotes(), equalTo("Temp is fine"));
        assertThat(ambientTemperature.getEffectiveTimeFrame(), equalTo(FIXED_MONTH));
        assertThat(ambientTemperature.getDescriptiveStatistic(), equalTo(MEDIAN));
    }

    @Test
    public void measureShouldSerializeCorrectly() throws Exception {

        AmbientTemperature ambientTemperature = new AmbientTemperature.Builder(new TemperatureUnitValue(CELSIUS, 34L))
                .setEffectiveTimeFrame(FIXED_POINT_IN_TIME)