DeviceTypeManagerService implements DeviceManagementService { private void populatePushNotificationConfig(PushNotificationProvider pushNotificationProvider) { if (pushNotificationProvider != null) { if (pushNotificationProvider.isFileBasedProperties()) { isRegistryBasedConfigs = false; Map<String, String> staticProps = new HashMap<>(); ConfigProperties configProperties = pushNotificationProvider.getConfigProperties(); if (configProperties != null) { List<Property> properties = configProperties.getProperty(); if (properties != null && !properties.isEmpty()) { for (Property property : properties) { staticProps.put(property.getName(), property.getValue()); } } } pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), staticProps); } else { isRegistryBasedConfigs = true; isScheduled = pushNotificationProvider.isScheduled(); notifierType = pushNotificationProvider.getType(); refreshPlatformConfigurations(); } } } 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 populateNotificationConfig method and retrieval of the same.") public void testPopulatePushNotificationConfig() throws InvocationTargetException, IllegalAccessException { populatePushNotificationConfig .invoke(androidDeviceTypeManagerService, androidDeviceConfiguration.getPushNotificationProvider()); PushNotificationConfig pushNotificationConfig = androidDeviceTypeManagerService.getPushNotificationConfig(); Assert.assertNotEquals(pushNotificationConfig, null, "Push notification configuration is set even though " + "Push notfication configuration was not mentioned."); populatePushNotificationConfig.invoke(rasberrypiDeviceTypeManagerService, rasberrypiDeviceConfiguration.getPushNotificationProvider()); pushNotificationConfig = rasberrypiDeviceTypeManagerService.getPushNotificationConfig(); PushNotificationProvider pushNotificationProvider = rasberrypiDeviceConfiguration.getPushNotificationProvider(); Assert.assertEquals(pushNotificationConfig.getType(), pushNotificationProvider.getType()); Assert.assertEquals(pushNotificationConfig.isScheduled(), pushNotificationProvider.isScheduled()); }