Package com.cumulocity.me.rest.representation.measurement

Examples of com.cumulocity.me.rest.representation.measurement.MeasurementCollectionRepresentation


        for (int i = 0; i < 12; i++) {
            MeasurementRepresentation rep = aSampleMeasurement((ManagedObjectRepresentation) managedObjects.get(0));
            measurementApi.create(rep);
        }

        MeasurementCollectionRepresentation measurements = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().get();
        MeasurementCollectionRepresentation page1st = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
                measurements, 1);
        MeasurementCollectionRepresentation page2nd = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
                measurements, 2);
        MeasurementCollectionRepresentation page3rd = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
                measurements, 3);
        MeasurementCollectionRepresentation page4th = (MeasurementCollectionRepresentation) measurementApi.getMeasurements().getPage(
                measurements, 4);

        assertThat(measurements.getMeasurements().size(), is(equalTo(5)));
        assertThat(page1st.getMeasurements().size(), is(equalTo(5)));
        assertThat(page2nd.getMeasurements().size(), is(equalTo(5)));
        assertThat(page3rd.getMeasurements().size(), is(equalTo(2)));
        assertThat(page4th.getMeasurements().size(), is(equalTo(0)));
    }
View Full Code Here


    }

    @Then("I should get next page which has current page '(\\d+)' and measurements '(\\d+)'")
    public void iQueryAllByNextPage(int currentPage, int numMeasurements) throws SDKException {
        try {
            MeasurementCollectionRepresentation collectionRepresentation = (MeasurementCollectionRepresentation) measurementApi
                    .getMeasurements().getNextPage(collection2);
            assertThat(currentPage, is(equalTo(collectionRepresentation.getPageStatistics().getCurrentPage())));
            assertThat(numMeasurements, is(equalTo(collectionRepresentation.getMeasurements().size())));
        } catch (SDKException ex) {
            status = ex.getHttpStatus();
        }

    }
View Full Code Here

    }

    @Then("I should get previous page which has current page '(\\d+)' and measurements '(\\d+)'")
    public void iQueryAllByPreviousPage(int currentPage, int numMeasurements) throws SDKException {
        try {
            MeasurementCollectionRepresentation collectionRepresentation = (MeasurementCollectionRepresentation) measurementApi
                    .getMeasurements().getPreviousPage(collection2);
            assertThat(currentPage, is(equalTo(collectionRepresentation.getPageStatistics().getCurrentPage())));
            assertThat(numMeasurements, is(equalTo(collectionRepresentation.getMeasurements().size())));
        } catch (SDKException ex) {
            status = ex.getHttpStatus();
        }

    }
View Full Code Here

TOP

Related Classes of com.cumulocity.me.rest.representation.measurement.MeasurementCollectionRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.