    @Test
    public void testGetMeasurements() throws Exception {


        final Results<Measurement> results = new Results<>();

        when(
                m_repository.select(
                        eq(Context.DEFAULT_CONTEXT),
                        eq(new Resource("localhost")),
                        eq(Optional.of(Timestamp.fromEpochSeconds(900000000))),
                        eq(Optional.of(Timestamp.fromEpochSeconds(900003600))),
                        any(ResultDescriptor.class),
                        eq(Optional.of(Duration.seconds(900))))
        ).thenReturn(results);

        // Reference the report by name
        assertThat(
                m_resource.getMeasurements(
                        "temps",
                        new Resource("localhost"),
                        Optional.of(new TimestampParam("1998-07-09T11:00:00-0500")),
                        Optional.of(new TimestampParam("1998-07-09T12:00:00-0500")),
                        Optional.of(new DurationParam("15m")),
                        Optional.<String>absent()),
                CoreMatchers.instanceOf(Collection.class));

        // Include the report in the request
        assertThat(
                m_resource.getMeasurements(
                        getResultDescriptorDTO(),
                        new Resource("localhost"),
                        Optional.of(new TimestampParam("1998-07-09T11:00:00-0500")),
                        Optional.of(new TimestampParam("1998-07-09T12:00:00-0500")),
                        Optional.of(new DurationParam("15m")),
                        Optional.<String>absent()),
                CoreMatchers.instanceOf(Collection.class));
    }