DeviceTypePluginDeployer extends AbstractDeployer { @Override public void undeploy(String filePath) throws DeploymentException { DeviceTypeConfigIdentifier deviceTypeConfigIdentifier = this.deviceTypeConfigurationDataMap.get(filePath); unregisterDeviceType(filePath); this.deviceTypeConfigurationDataMap.remove(filePath); log.info("Device Type undeployed successfully : " + deviceTypeConfigIdentifier.getDeviceType() + " for tenant " + deviceTypeConfigIdentifier.getTenantDomain()); }  @Override void init(ConfigurationContext configurationContext); @Override void setDirectory(String s); @Override void setExtension(String s); @Override void deploy(DeploymentFileData deploymentFileData); @Override void undeploy(String filePath);  }
@SuppressWarnings("unchecked") @Test(dependsOnMethods = {"deploy"} , description = "Testing deviceType undeploy method by un-deploying Android " + "device type") public void unDeploy() throws DeploymentException, IllegalAccessException { deviceTypePluginDeployer.undeploy(deploymentFileData.getAbsolutePath()); Map<String, ServiceRegistration> tempServiceRegistration = (Map<String, ServiceRegistration>) deviceTypeServiceRegistrations.get(deviceTypePluginDeployer); Assert.assertNull(tempServiceRegistration.get(deploymentFileData.getAbsolutePath())); Map<String, DeviceTypeConfigIdentifier> tempDeviceTypeConfig = (Map<String, DeviceTypeConfigIdentifier>) deviceTypeConfigurationDataMap.get(deviceTypePluginDeployer); Assert.assertNull(tempDeviceTypeConfig.get(deploymentFileData.getAbsolutePath())); }