Search in sources :

Example 6 with PIICategory

use of org.wso2.carbon.consent.mgt.core.model.PIICategory in project product-is by wso2.

the class ConsentMgtTestCase method testAddPIICategory.

@Test(alwaysRun = true, groups = "wso2.is", description = "Add PII Category test")
public void testAddPIICategory() {
    String name = "http://wso2.org/claims/organization";
    String description = "Organization";
    JSONObject response = addPIICategory(name, description);
    Assert.assertEquals(name, response.get("piiCategory"));
    Assert.assertEquals(description, response.get("description"));
    Assert.assertEquals(true, response.get("sensitive"));
}
Also used : JSONObject(org.json.simple.JSONObject) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest) Test(org.testng.annotations.Test)

Example 7 with PIICategory

use of org.wso2.carbon.consent.mgt.core.model.PIICategory in project product-is by wso2.

the class SelfSignUpConsentTest method addPIICategory.

private void addPIICategory(String name, String description) {
    RestClient restClient = new RestClient();
    Resource piiCatResource = restClient.resource(consentEndpoint + "/" + "pii-categories");
    String addPIICatString = "{\"piiCategory\": " + "\"" + name + "\"" + ", \"description\": " + "\"" + description + "\" , \"sensitive\": \"" + true + "\"}";
    User user = new User();
    user.setUserName(tenantAdminUserName);
    user.setPassword(ADMIN);
    piiCatResource.contentType(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON).header(HttpHeaders.AUTHORIZATION, getBasicAuthHeader(user)).post(String.class, addPIICatString);
}
Also used : User(org.wso2.carbon.automation.engine.context.beans.User) RestClient(org.apache.wink.client.RestClient) Resource(org.apache.wink.client.Resource)

Aggregations

PIICategoryValidity (org.wso2.carbon.consent.mgt.core.model.PIICategoryValidity)4 ArrayList (java.util.ArrayList)3 Test (org.testng.annotations.Test)2 ConsentManagementException (org.wso2.carbon.consent.mgt.core.exception.ConsentManagementException)2 PIICategory (org.wso2.carbon.consent.mgt.core.model.PIICategory)2 ReceiptPurposeInput (org.wso2.carbon.consent.mgt.core.model.ReceiptPurposeInput)2 SSOConsentServiceException (org.wso2.carbon.identity.application.authentication.framework.handler.request.impl.consent.exception.SSOConsentServiceException)2 HashSet (java.util.HashSet)1 Resource (org.apache.wink.client.Resource)1 RestClient (org.apache.wink.client.RestClient)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1 JSONObject (org.json.simple.JSONObject)1 User (org.wso2.carbon.automation.engine.context.beans.User)1 ConsentManagementClientException (org.wso2.carbon.consent.mgt.core.exception.ConsentManagementClientException)1 Address (org.wso2.carbon.consent.mgt.core.model.Address)1 ConsentPurpose (org.wso2.carbon.consent.mgt.core.model.ConsentPurpose)1 PiiController (org.wso2.carbon.consent.mgt.core.model.PiiController)1 Receipt (org.wso2.carbon.consent.mgt.core.model.Receipt)1 ReceiptService (org.wso2.carbon.consent.mgt.core.model.ReceiptService)1