DeviceTypeManagerService implements DeviceManagementService { protected void setInitialOperationConfig(DeviceTypeConfiguration deviceTypeConfiguration) { if (deviceTypeConfiguration.getOperations() != null) { List<String> ops = deviceTypeConfiguration.getOperations(); if (!ops.isEmpty() && deviceTypeConfiguration.getFeatures() != null && deviceTypeConfiguration.getFeatures().getFeature() != null) { List<String> validOps = new ArrayList<>(); for (String operation : ops) { boolean isFeatureExist = false; for (Feature feature : deviceTypeConfiguration.getFeatures().getFeature()) { if (feature.getCode().equals(operation)) { isFeatureExist = true; break; } } if (isFeatureExist) { validOps.add(operation); } else { log.warn("Couldn't fine a valid feature for the operation : " + operation); } } initialOperationConfig.setOperations(validOps); } } } DeviceTypeManagerService(DeviceTypeConfigIdentifier deviceTypeConfigIdentifier,
                                    DeviceTypeConfiguration deviceTypeConfiguration); @Override String getType(); @Override OperationMonitoringTaskConfig getOperationMonitoringConfig(); @Override void init(); @Override DeviceManager getDeviceManager(); @Override ApplicationManager getApplicationManager(); @Override ProvisioningConfig getProvisioningConfig(); @Override PushNotificationConfig getPushNotificationConfig(); @Override PolicyMonitoringManager getPolicyMonitoringManager(); @Override InitialOperationConfig getInitialOperationConfig(); @Override PullNotificationSubscriber getPullNotificationSubscriber(); DeviceStatusTaskPluginConfig getDeviceStatusTaskPluginConfig(); @Override GeneralConfig getGeneralConfig(); void setGeneralConfig(DeviceTypeConfiguration deviceTypeConfiguration);  }
@Test(description = "This test case tests the initial operation configuration setting and retrieval of the same.") public void testSetInitialOperationConfig() throws InvocationTargetException, IllegalAccessException { androidDeviceTypeManagerService.setInitialOperationConfig(androidDeviceConfiguration); InitialOperationConfig initialOperationConfig = androidDeviceTypeManagerService.getInitialOperationConfig(); Assert.assertEquals(initialOperationConfig.getOperations().size(),androidDeviceConfiguration.getOperations() .size()); }