DefaultApplicationSlaManagementService implements ApplicationSlaManagementService { @Override public Collection<ApplicationSLA> getApplicationSLAs() { return storage.findAll().onErrorReturn(t -> null) .toList().toBlocking().firstOrDefault(Collections.emptyList()); } @Inject  DefaultApplicationSlaManagementService(CapacityMonitoringService capacityMonitoringService,
                                                  ApplicationSlaStore storage,
                                                  ManagementSubsystemInitializer initializer); @Override Collection<ApplicationSLA> getApplicationSLAs(); @Override Collection<ApplicationSLA> getApplicationSLAsForScheduler(String schedulerName); @Override Optional<ApplicationSLA> findApplicationSLA(String applicationName); @Override ApplicationSLA getApplicationSLA(String applicationName); @Override Observable<Void> addApplicationSLA(ApplicationSLA applicationSLA); @Override Observable<Void> removeApplicationSLA(String applicationName);  }
@Test public void testGetAllApplicationSLAs() throws Exception { when(storage.findAll()).thenReturn(Observable.from(generator.next(2))); List<ApplicationSLA> result = new ArrayList<>(slaManagementService.getApplicationSLAs()); assertThat(result).hasSize(2); }