alarmApi.create(rep);
}
AlarmFilter filter = new AlarmFilter().bySource(source1);
// When
AlarmCollectionRepresentation alarms = (AlarmCollectionRepresentation) alarmApi.getAlarmsByFilter(filter).get();
// Then
assertThat(alarms.getAlarms().size()).isEqualTo(5);
// When
AlarmCollectionRepresentation page1st = (AlarmCollectionRepresentation) alarmApi.getAlarmsByFilter(filter).getPage(alarms, 1);
// Then
assertThat(page1st.getAlarms().size()).isEqualTo(5);
// When
AlarmCollectionRepresentation page2nd = (AlarmCollectionRepresentation) alarmApi.getAlarmsByFilter(filter).getPage(alarms, 2);
// Then
assertThat(page2nd.getAlarms().size()).isEqualTo(5);
// When
AlarmCollectionRepresentation page3rd = (AlarmCollectionRepresentation) alarmApi.getAlarmsByFilter(filter).getPage(alarms, 3);
// Then
assertThat(page3rd.getAlarms().size()).isEqualTo(2);
// When
AlarmCollectionRepresentation page4th = (AlarmCollectionRepresentation) alarmApi.getAlarmsByFilter(filter).getPage(alarms, 4);
// Then
assertThat(page4th.getAlarms().size()).isEqualTo(0);
}