Examples of AlarmCollectionRepresentation


Examples of com.cumulocity.rest.representation.alarm.AlarmCollectionRepresentation

        alarmApi.create(aSampleAlarm(mo1));
        alarmApi.create(aSampleAlarm(mo2));

        // When
        AlarmFilter filter = new AlarmFilter().bySource(mo1);
        AlarmCollectionRepresentation bySource = alarmApi.getAlarmsByFilter(filter).get();

        // Then
        List<AlarmRepresentation> alarms = bySource.getAlarms();
        assertThat(alarms.size(), is(equalTo(1)));
        assertThat(alarms.get(0).getSource().getId(), is(mo1.getId()));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.alarm.AlarmCollectionRepresentation

                .withStatus("ACKNOWLEDGED")
                .withSource(mo1).build());

        // When
        AlarmFilter acknowledgedFilter = new AlarmFilter().byStatus(CumulocityAlarmStatuses.valueOf("ACKNOWLEDGED"));
        AlarmCollectionRepresentation acknowledgedAlarms = alarmApi.getAlarmsByFilter(acknowledgedFilter).get();

        // Then
        List<AlarmRepresentation> alarms = acknowledgedAlarms.getAlarms();
        assertThat(alarms.size(), is(equalTo(1)));
        assertThat(alarms.get(0).getStatus(), is("ACKNOWLEDGED"));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.alarm.AlarmCollectionRepresentation

                .withStatus("ACKNOWLEDGED")
                .withSource(mo2).build());

        // When
        AlarmFilter acknowledgedFilter = new AlarmFilter().byStatus(CumulocityAlarmStatuses.valueOf("ACKNOWLEDGED")).bySource(mo1);
        AlarmCollectionRepresentation acknowledgedAlarms = alarmApi.getAlarmsByFilter(acknowledgedFilter).get();

        // Then
        List<AlarmRepresentation> alarms = acknowledgedAlarms.getAlarms();
        assertThat(alarms.size(), is(equalTo(1)));
        assertThat(alarms.get(0).getStatus(), is("ACKNOWLEDGED"));
        assertThat(alarms.get(0).getSource().getId(), is(mo1.getId()));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.alarm.AlarmCollectionRepresentation

    @Before
    public void setup() throws Exception {
        MockitoAnnotations.initMocks(this);

        AlarmCollectionRepresentation alarmCollectionRepresentation = new AlarmCollectionRepresentation();
        alarmCollectionRepresentation.setSelf(ALARM_COLLECTION_URL);
        alarmsApiRepresentation.setAlarms(alarmCollectionRepresentation);

        alarmApi = new AlarmApiImpl(restConnector, urlProcessor, alarmsApiRepresentation, DEFAULT_PAGE_SIZE);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.