PolicyManagerServiceImpl implements PolicyManagerService { @Override public Profile addProfile(Profile profile) throws PolicyManagementException { return policyAdministratorPoint.addProfile(profile); } PolicyManagerServiceImpl(); @Override Profile addProfile(Profile profile); @Override Profile updateProfile(Profile profile); @Override Policy addPolicy(Policy policy); @Override Policy updatePolicy(Policy policy); @Override boolean deletePolicy(Policy policy); @Override boolean deletePolicy(int policyId); @Override Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier); @Override List<ProfileFeature> getEffectiveFeatures(DeviceIdentifier deviceIdentifier); @Override List<Policy> getPolicies(String deviceType); @Override List<Feature> getFeatures(); @Override PolicyAdministratorPoint getPAP(); @Override PolicyInformationPoint getPIP(); @Override PolicyEvaluationPoint getPEP(); @Override TaskScheduleService getTaskScheduleService(); @Override int getPolicyCount(); @Override Policy getAppliedPolicyToDevice(
            DeviceIdentifier deviceIdentifier); @Override List<ComplianceFeature> checkPolicyCompliance(DeviceIdentifier deviceIdentifier, Object
            deviceResponse); @Override boolean checkCompliance(DeviceIdentifier deviceIdentifier, Object response); @Override NonComplianceData getDeviceCompliance(DeviceIdentifier deviceIdentifier); @Override boolean isCompliant(DeviceIdentifier deviceIdentifier);  }
@Test(dependsOnMethods = "applyPolicy") public void addProfile() throws Exception{ int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); profile = new Profile(); profile.setTenantId(tenantId); profile.setCreatedDate(new Timestamp(System.currentTimeMillis())); profile.setDeviceType(DEVICE_TYPE_A); List<ProfileFeature> profileFeatures = new ArrayList<ProfileFeature>(); ProfileFeature profileFeature = new ProfileFeature(); profileFeature.setContent("{'enable':'true'}"); profileFeature.setDeviceType(DEVICE_TYPE_A); profileFeature.setFeatureCode(POLICY1_FEATURE1_CODE); profileFeatures.add(profileFeature); profile.setProfileFeaturesList(profileFeatures); profile.setProfileName("tp_profile2"); profile.setUpdatedDate(new Timestamp(System.currentTimeMillis())); Profile profile1 = policyManagerService.addProfile(profile); Assert.assertNotNull(profile1); Assert.assertEquals("tp_profile2",profile1.getProfileName()); }