From 72694d021229ed2812623a5bd4db3010763e228d Mon Sep 17 00:00:00 2001 From: saimanaswini-k Date: Mon, 9 Sep 2024 11:13:53 +0530 Subject: [PATCH] Feat : Code cleanup for deprecated APIs --- .../app/controllers/BaseController.java | 24 +- controller/app/util/RequestInterceptor.java | 14 +- .../controllers/feed/FeedControllerTest.java | 26 +- .../OrganisationControllerTest.java | 26 +- .../controllers/otp/OtpControllerTest.java | 110 ++--- .../UserConsentControllerTest.java | 10 +- .../usermanagement/UserControllerTest.java | 382 +++++++++--------- .../usermanagement/UserControllerTest2.java | 2 +- .../UserRoleControllerTest.java | 78 ++-- .../service-policies/policies_test.rego | 144 +++---- 10 files changed, 408 insertions(+), 408 deletions(-) diff --git a/controller/app/controllers/BaseController.java b/controller/app/controllers/BaseController.java index 6a3f662245..50a8adb7b3 100644 --- a/controller/app/controllers/BaseController.java +++ b/controller/app/controllers/BaseController.java @@ -469,12 +469,12 @@ public static Response createResponseOnException( private static void handleBackwardCompatibility( Request request, ProjectCommonException exception, Response response) { // This code is for backwards compatibility - if (request.path() != null && request.path().startsWith("/v1/otp/generate")) { - if ("errorRateLimitExceeded".equalsIgnoreCase(exception.getResponseCode().name())) { - response.getParams().setErr("ERROR_RATE_LIMIT_EXCEEDED"); - response.getParams().setStatus("ERROR_RATE_LIMIT_EXCEEDED"); - } - } + //if (request.path() != null && request.path().startsWith("/v1/otp/generate")) { + // if ("errorRateLimitExceeded".equalsIgnoreCase(exception.getResponseCode().name())) { + // response.getParams().setErr("ERROR_RATE_LIMIT_EXCEEDED"); + // response.getParams().setStatus("ERROR_RATE_LIMIT_EXCEEDED"); + // } + //} if (request.path() != null && request.path().startsWith("/v1/otp/verify") @@ -491,12 +491,12 @@ private static void handleBackwardCompatibility( response.getParams().setStatus("MANAGED_USER_LIMIT_EXCEEDED"); } - if (request.path() != null - && (request.path().startsWith("/v1/user/consent/read")) - && ("resourceNotFound".equalsIgnoreCase(exception.getResponseCode().name()))) { - response.getParams().setErr("USER_CONSENT_NOT_FOUND"); - response.getParams().setStatus("USER_CONSENT_NOT_FOUND"); - } + //if (request.path() != null + // && (request.path().startsWith("/v1/user/consent/read")) + // && ("resourceNotFound".equalsIgnoreCase(exception.getResponseCode().name()))) { + // response.getParams().setErr("USER_CONSENT_NOT_FOUND"); + // response.getParams().setStatus("USER_CONSENT_NOT_FOUND"); + //} if (request.path() != null && (request.path().startsWith("/v1/user/get/")) && ("resourceNotFound".equalsIgnoreCase(exception.getResponseCode().name()))) { diff --git a/controller/app/util/RequestInterceptor.java b/controller/app/util/RequestInterceptor.java index 54ac64bb65..2df1866c84 100644 --- a/controller/app/util/RequestInterceptor.java +++ b/controller/app/util/RequestInterceptor.java @@ -33,7 +33,7 @@ private RequestInterceptor() {} static { restrictedUriList = new ArrayList<>(); - restrictedUriList.add("/v1/user/update"); + //restrictedUriList.add("/v1/user/update"); restrictedUriList.add("/v1/note/create"); restrictedUriList.add("/v1/note/update"); restrictedUriList.add("/v1/note/search"); @@ -43,12 +43,12 @@ private RequestInterceptor() {} // --------------------------- short var = 1; - apiHeaderIgnoreMap.put("/v1/user/create", var); - apiHeaderIgnoreMap.put("/v2/user/create", var); + //apiHeaderIgnoreMap.put("/v1/user/create", var); + //apiHeaderIgnoreMap.put("/v2/user/create", var); apiHeaderIgnoreMap.put("/v2/org/search", var); apiHeaderIgnoreMap.put("/v2/org/preferences/read", var); - apiHeaderIgnoreMap.put("/v3/user/create", var); - apiHeaderIgnoreMap.put("/v1/user/signup", var); + //apiHeaderIgnoreMap.put("/v3/user/create", var); + //apiHeaderIgnoreMap.put("/v1/user/signup", var); apiHeaderIgnoreMap.put("/v1/org/create", var); apiHeaderIgnoreMap.put("/v1/system/settings/set", var); apiHeaderIgnoreMap.put("/v1/org/update/encryptionkey", var); @@ -58,7 +58,7 @@ private RequestInterceptor() {} apiHeaderIgnoreMap.put("/v1/org/assign/key", var); apiHeaderIgnoreMap.put("/v2/user/signup", var); apiHeaderIgnoreMap.put("/v1/ssouser/create", var); - apiHeaderIgnoreMap.put("/v1/org/search", var); + //apiHeaderIgnoreMap.put("/v1/org/search", var); apiHeaderIgnoreMap.put("/service/health", var); apiHeaderIgnoreMap.put("/health", var); apiHeaderIgnoreMap.put("/v1/notification/email", var); @@ -73,7 +73,7 @@ private RequestInterceptor() {} apiHeaderIgnoreMap.put("/v1/location/update", var); apiHeaderIgnoreMap.put("/v1/location/search", var); apiHeaderIgnoreMap.put("/v1/location/delete", var); - apiHeaderIgnoreMap.put("/v1/otp/generate", var); + //apiHeaderIgnoreMap.put("/v1/otp/generate", var); apiHeaderIgnoreMap.put("/v1/otp/verify", var); apiHeaderIgnoreMap.put("/v2/otp/generate", var); apiHeaderIgnoreMap.put("/v2/otp/verify", var); diff --git a/controller/test/controllers/feed/FeedControllerTest.java b/controller/test/controllers/feed/FeedControllerTest.java index 223e8af506..f354226c5b 100644 --- a/controller/test/controllers/feed/FeedControllerTest.java +++ b/controller/test/controllers/feed/FeedControllerTest.java @@ -32,9 +32,9 @@ @Ignore public class FeedControllerTest extends BaseApplicationTest { - String SAVE_FEED_URL = "/v1/user/feed/create"; + //String SAVE_FEED_URL = "/v1/user/feed/create"; String UPDATE_FEED_URL = "/v1/user/feed/update"; - String DELETE_FEED_URL = "/v1/user/feed/delete"; + //String DELETE_FEED_URL = "/v1/user/feed/delete"; @Before public void before() { @@ -70,11 +70,11 @@ public void testUpdateUserFeed() { assertTrue(getResponseStatus(result) == 200); } - public void testCreateUserFeed() { - Result result = performTest(SAVE_FEED_URL, HttpMethods.POST.name(), createFeedRequest(true)); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } + //public void testCreateUserFeed() { + // Result result = performTest(SAVE_FEED_URL, HttpMethods.POST.name(), createFeedRequest(true)); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + //} @Test public void testUpdateUserFeedFailureForUserID() { @@ -85,12 +85,12 @@ public void testUpdateUserFeedFailureForUserID() { assertTrue(getResponseStatus(result) == 400); } - @Test - public void testDeleteUserFeed() { - Result result = performTest(DELETE_FEED_URL, HttpMethods.POST.name(), updateFeedRequest(true)); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } + //@Test + //public void testDeleteUserFeed() { + // Result result = performTest(DELETE_FEED_URL, HttpMethods.POST.name(), updateFeedRequest(true)); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + //} private Map updateFeedRequest(boolean setUserid) { Map requestMap = new HashMap<>(); diff --git a/controller/test/controllers/organisationmanagement/OrganisationControllerTest.java b/controller/test/controllers/organisationmanagement/OrganisationControllerTest.java index 18525c98c2..7ef3c255a2 100644 --- a/controller/test/controllers/organisationmanagement/OrganisationControllerTest.java +++ b/controller/test/controllers/organisationmanagement/OrganisationControllerTest.java @@ -171,13 +171,13 @@ public void testGetOrgDetailsFailureWithoutOrgId() { assertEquals(400, getResponseStatus(result)); } - @Test - public void testSearchOrgSuccess() { - Result result = - performTest("/v1/org/search", "POST", searchOrganisationRequest(status, new HashMap<>())); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertEquals(200, getResponseStatus(result)); - } + //@Test + //public void testSearchOrgSuccess() { + // Result result = + // performTest("/v1/org/search", "POST", searchOrganisationRequest(status, new HashMap<>())); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertEquals(200, getResponseStatus(result)); + //} @Test public void testSearchOrgV2Success() { @@ -187,12 +187,12 @@ public void testSearchOrgV2Success() { assertEquals(200, getResponseStatus(result)); } - @Test - public void testSearchOrgFailureWithoutFilters() { - Result result = performTest("/v1/org/search", "POST", searchOrganisationRequest(status, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertEquals(400, getResponseStatus(result)); - } + //@Test + //public void testSearchOrgFailureWithoutFilters() { + // Result result = performTest("/v1/org/search", "POST", searchOrganisationRequest(status, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertEquals(400, getResponseStatus(result)); + //} @Test public void testAddEncyptionKeyPublicPem() throws IOException { diff --git a/controller/test/controllers/otp/OtpControllerTest.java b/controller/test/controllers/otp/OtpControllerTest.java index 2080f6b08f..a7851887d1 100644 --- a/controller/test/controllers/otp/OtpControllerTest.java +++ b/controller/test/controllers/otp/OtpControllerTest.java @@ -40,7 +40,7 @@ public class OtpControllerTest extends BaseApplicationTest { private static final String VALID_EMAIL_TYPE = "email"; private static final String INVALID_TYPE = "invalidType"; private static final String INVALID_OTP = "anyOtp"; - private static final String GENERATE_OTP_URL = "/v1/otp/generate"; + //private static final String GENERATE_OTP_URL = "/v1/otp/generate"; private static final String VERIFY_OTP_URL = "/v1/otp/verify"; @Before @@ -48,60 +48,60 @@ public void before() { setup(ACTORS.OTP_ACTOR, DummyActor.class); } - @Test - public void testGenerateOtpFailureWithoutPhoneKey() { - Result result = - performTest( - GENERATE_OTP_URL, - HttpMethods.POST.name(), - createInvalidOtpRequest(false, null, true, VALID_PHONE_TYPE, false, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testGenerateOtpFailureWithInvalidPhone() { - Result result = - performTest( - GENERATE_OTP_URL, - HttpMethods.POST.name(), - createInvalidOtpRequest(true, INVALID_PHONE, true, VALID_PHONE_TYPE, false, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testGenerateOtpFailureWithoutEmailKey() { - Result result = - performTest( - GENERATE_OTP_URL, - HttpMethods.POST.name(), - createInvalidOtpRequest(false, null, true, VALID_EMAIL_TYPE, false, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testGenerateOtpFailureWithInvalidEmail() { - Result result = - performTest( - GENERATE_OTP_URL, - HttpMethods.POST.name(), - createInvalidOtpRequest(true, INVALID_EMAIL, true, VALID_EMAIL_TYPE, false, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testGenerateOtpFailureWithInvalidType() { - Result result = - performTest( - GENERATE_OTP_URL, - HttpMethods.POST.name(), - createInvalidOtpRequest(true, VALID_EMAIL, true, INVALID_TYPE, false, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } + //@Test + //public void testGenerateOtpFailureWithoutPhoneKey() { + // Result result = + // performTest( + // GENERATE_OTP_URL, + // HttpMethods.POST.name(), + // createInvalidOtpRequest(false, null, true, VALID_PHONE_TYPE, false, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testGenerateOtpFailureWithInvalidPhone() { + // Result result = + // performTest( + // GENERATE_OTP_URL, + // HttpMethods.POST.name(), + // createInvalidOtpRequest(true, INVALID_PHONE, true, VALID_PHONE_TYPE, false, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testGenerateOtpFailureWithoutEmailKey() { + // Result result = + // performTest( + // GENERATE_OTP_URL, + // HttpMethods.POST.name(), + // createInvalidOtpRequest(false, null, true, VALID_EMAIL_TYPE, false, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testGenerateOtpFailureWithInvalidEmail() { + // Result result = + // performTest( + // GENERATE_OTP_URL, + // HttpMethods.POST.name(), + // createInvalidOtpRequest(true, INVALID_EMAIL, true, VALID_EMAIL_TYPE, false, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testGenerateOtpFailureWithInvalidType() { + // Result result = + // performTest( + // GENERATE_OTP_URL, + // HttpMethods.POST.name(), + // createInvalidOtpRequest(true, VALID_EMAIL, true, INVALID_TYPE, false, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} @Test public void testVerifyOtpFailureWithoutPhoneKey() { diff --git a/controller/test/controllers/usermanagement/UserConsentControllerTest.java b/controller/test/controllers/usermanagement/UserConsentControllerTest.java index d67e85538d..937eb8383d 100644 --- a/controller/test/controllers/usermanagement/UserConsentControllerTest.java +++ b/controller/test/controllers/usermanagement/UserConsentControllerTest.java @@ -55,11 +55,11 @@ public void updateUserConsentSuccess() { assertTrue(getResponseStatus(result) == Response.Status.OK.getStatusCode()); } - @Test - public void getUserConsentSuccess() { - Result result = performTest("/v1/user/consent/read", "POST", (Map) getUserConsentRequest()); - assertTrue(getResponseStatus(result) == Response.Status.OK.getStatusCode()); - } + //@Test + //public void getUserConsentSuccess() { + // Result result = performTest("/v1/user/consent/read", "POST", (Map) getUserConsentRequest()); + // assertTrue(getResponseStatus(result) == Response.Status.OK.getStatusCode()); + //} public static Map getUserConsentRequest() { Map filters = new HashMap(); diff --git a/controller/test/controllers/usermanagement/UserControllerTest.java b/controller/test/controllers/usermanagement/UserControllerTest.java index 1cb3bb7f79..61b7ee12fe 100644 --- a/controller/test/controllers/usermanagement/UserControllerTest.java +++ b/controller/test/controllers/usermanagement/UserControllerTest.java @@ -57,7 +57,7 @@ public class UserControllerTest extends BaseApplicationTest { private static String query = "query"; private static String language = "any-language"; private static String role = "user"; - private static final String UPDATE_URL = "/v1/user/update"; + //private static final String UPDATE_URL = "/v1/user/update"; public static final String USER_EXISTS_API = "/v1/user/exists/"; public static Map> headerMap; @@ -85,37 +85,37 @@ public void before() { headerMap.put(HeaderParam.X_APP_ID.getName(), Arrays.asList("Some app Id")); } - @Test - public void testCreateUserSuccess() { - - Result result = - performTest( - "/v1/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } - - @Test - public void testCreateUserV3Success() { - - Result result = - performTest( - "/v1/user/signup", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } - - @Test - public void testCreateUserV3SyncSuccess() { - Result result = - performTest( - "/v3/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } + //@Test + //public void testCreateUserSuccess() { + // + // Result result = + // performTest( + // "/v1/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} + + //@Test + //public void testCreateUserV3Success() { + + // Result result = + // performTest( + // "/v1/user/signup", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} + + //@Test + //public void testCreateUserV3SyncSuccess() { + // Result result = + // performTest( + // "/v3/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} @Test public void testCreateUserV2SyncSuccess() { @@ -127,79 +127,79 @@ public void testCreateUserV2SyncSuccess() { assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); } - @Test - public void testCreateUserV3WithInvalidPassLength() { - Result result = - performTest( - "/v1/user/signup", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab@1214")); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testCreateUserWithInvalidPassLength() { - Result result = - performTest( - "/v1/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab@1214")); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testCreateUserWithOutUpperCasePass() { - Result result = - performTest( - "/v1/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "ab@12148")); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testCreateUserWithOutSpecialCharPass() { - Result result = - performTest( - "/v1/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "ab312148")); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testCreateUserWithCorrectPass() { - Result result = - performTest( - "/v1/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } - - @Test - public void testCreateUserV3WithCorrectPass() { - Result result = - performTest( - "/v1/user/signup", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } - - @Test - public void testCreateUserV4Success() { - Result result = - performTest( - "/v4/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } + //@Test + //public void testCreateUserV3WithInvalidPassLength() { + // Result result = + // performTest( + // "/v1/user/signup", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab@1214")); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testCreateUserWithInvalidPassLength() { + // Result result = + // performTest( + // "/v1/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab@1214")); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testCreateUserWithOutUpperCasePass() { + // Result result = + // performTest( + // "/v1/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "ab@12148")); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testCreateUserWithOutSpecialCharPass() { + // Result result = + // performTest( + // "/v1/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "ab312148")); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testCreateUserWithCorrectPass() { + // Result result = + // performTest( + // "/v1/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} + + //@Test + //public void testCreateUserV3WithCorrectPass() { + // Result result = + // performTest( + // "/v1/user/signup", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} + + //@Test + //public void testCreateUserV4Success() { + // Result result = + // performTest( + // "/v4/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} @Test public void testCreateUserV3V2WithCorrectPass() { @@ -211,57 +211,57 @@ public void testCreateUserV3V2WithCorrectPass() { assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); } - @Test - public void testCreateUserV4V2WithCorrectPass() { - Result result = - performTest( - "/v1/manageduser/create", - "POST", - (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - } + //@Test + //public void testCreateUserV4V2WithCorrectPass() { + // Result result = + // performTest( + // "/v1/manageduser/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, phoneNumber, null, true, "Ab3#$2148")); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //} // @Test - public void testCreateUserFailureWithoutContentType() { - String data = (String) createOrUpdateUserRequest(userName, phoneNumber, null, false, null); - RequestBuilder req = new RequestBuilder().bodyText(data).uri("/v1/user/create").method("POST"); + //public void testCreateUserFailureWithoutContentType() { + // String data = (String) createOrUpdateUserRequest(userName, phoneNumber, null, false, null); + // RequestBuilder req = new RequestBuilder().bodyText(data).uri("/v1/user/create").method("POST"); // req.headers(headerMap); - Result result = Helpers.route(application, req); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testCreateUserFailureWithInvalidPhoneNumber() { - Result result = - performTest( - "/v1/user/create", - "POST", - (Map) createOrUpdateUserRequest(userName, invalidPhonenumber, null, true, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testUpdateUserSuccess() throws Exception { - Result result = - performTest( - "/v1/user/update", - "PATCH", - (Map) createOrUpdateUserRequest(null, phoneNumber, userId, true, null)); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } - - @Test - public void testUpdateUserV2Success() throws Exception { - Result result = - performTest( - "/v2/user/update", - "PATCH", - (Map) createOrUpdateUserRequest(null, phoneNumber, userId, true, null)); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } + // Result result = Helpers.route(application, req); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testCreateUserFailureWithInvalidPhoneNumber() { + // Result result = + // performTest( + // "/v1/user/create", + // "POST", + // (Map) createOrUpdateUserRequest(userName, invalidPhonenumber, null, true, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testUpdateUserSuccess() throws Exception { + // Result result = + // performTest( + // "/v1/user/update", + // "PATCH", + // (Map) createOrUpdateUserRequest(null, phoneNumber, userId, true, null)); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + //} + + //@Test + //public void testUpdateUserV2Success() throws Exception { + // Result result = + // performTest( + // "/v2/user/update", + // "PATCH", + // (Map) createOrUpdateUserRequest(null, phoneNumber, userId, true, null)); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + //} @Test public void testUpdateUserV3Success() throws Exception { @@ -274,16 +274,16 @@ public void testUpdateUserV3Success() throws Exception { assertTrue(getResponseStatus(result) == 200); } - @Test - public void testUpdateUserFailureWithInvalidPhoneNumber() { - Result result = - performTest( - "/v1/user/update", - "PATCH", - (Map) createOrUpdateUserRequest(null, invalidPhonenumber, userId, true, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } + //@Test + //public void testUpdateUserFailureWithInvalidPhoneNumber() { + // Result result = + // performTest( + // "/v1/user/update", + // "PATCH", + // (Map) createOrUpdateUserRequest(null, invalidPhonenumber, userId, true, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} @Test public void testGetUserDetailsSuccessByUserId() { @@ -339,19 +339,19 @@ public void testGetUserDetailsFailureWithoutLoginId() { assertTrue(getResponseStatus(result) == 400); } - @Test - public void testSearchUserSuccess() { - Result result = performTest("/v1/user/search", "POST", searchUserRequest(new HashMap<>())); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } + //@Test + //public void testSearchUserSuccess() { + // Result result = performTest("/v1/user/search", "POST", searchUserRequest(new HashMap<>())); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + // } - @Test - public void testSearchUserSuccessV2() { - Result result = performTest("/v2/user/search", "POST", searchUserRequest(new HashMap<>())); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } + //@Test + //public void testSearchUserSuccessV2() { + // Result result = performTest("/v2/user/search", "POST", searchUserRequest(new HashMap<>())); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + //} @Test public void testSearchUserSuccessV3() { @@ -374,21 +374,21 @@ public void testSearchUserFailureWithoutFilter() { assertTrue(getResponseStatus(result) == 400); } - @Test - public void testUpdateUserFrameworkSuccess() { - Result result = - performTest(UPDATE_URL, "PATCH", (Map) updateUserFrameworkRequest(userId, "NCF", true)); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } - - @Test - public void testUpdateUserFrameworkFailure() { - Result result = - performTest(UPDATE_URL, "PATCH", (Map) updateUserFrameworkRequest(userId, "NCF", false)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } + //@Test + //public void testUpdateUserFrameworkSuccess() { + // Result result = + // performTest(UPDATE_URL, "PATCH", (Map) updateUserFrameworkRequest(userId, "NCF", true)); + // assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + // assertTrue(getResponseStatus(result) == 200); + //} + + //@Test + //public void testUpdateUserFrameworkFailure() { + // Result result = + // performTest(UPDATE_URL, "PATCH", (Map) updateUserFrameworkRequest(userId, "NCF", false)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} private Map updateUserFrameworkRequest(String userId, String frameworkId, boolean success) { Map request = new HashMap<>(); diff --git a/controller/test/controllers/usermanagement/UserControllerTest2.java b/controller/test/controllers/usermanagement/UserControllerTest2.java index f4ff35d1ab..932732cb55 100644 --- a/controller/test/controllers/usermanagement/UserControllerTest2.java +++ b/controller/test/controllers/usermanagement/UserControllerTest2.java @@ -48,7 +48,7 @@ public class UserControllerTest2 extends BaseApplicationTest { private static String query = "query"; private static String language = "any-language"; private static String role = "user"; - private static final String UPDATE_URL = "/v1/user/update"; + //private static final String UPDATE_URL = "/v1/user/update"; public static final String USER_EXISTS_API = "/v1/user/exists/"; public static Map> headerMap; diff --git a/controller/test/controllers/usermanagement/UserRoleControllerTest.java b/controller/test/controllers/usermanagement/UserRoleControllerTest.java index 475a16bac2..db2006df80 100644 --- a/controller/test/controllers/usermanagement/UserRoleControllerTest.java +++ b/controller/test/controllers/usermanagement/UserRoleControllerTest.java @@ -40,14 +40,14 @@ public void before() throws Exception { setup(Arrays.asList(ACTORS.USER_ROLE_ACTOR, ACTORS.FETCH_USER_ROLE_ACTOR), DummyActor.class); } - @Test - public void testAssignRolesSuccess() { + //@Test + //public void testAssignRolesSuccess() { // setup(DummyActor.class); - Result result = - performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, true, true, role)); - assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); - assertTrue(getResponseStatus(result) == 200); - } + //Result result = + // performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, true, true, role)); + //assertEquals(getResponseCode(result), ResponseCode.SUCCESS.name()); + //assertTrue(getResponseStatus(result) == 200); + //} @Test public void testAssignRolesV2Success() { @@ -121,38 +121,38 @@ public void testAssignRolesV2FailureWithoutScope() { assertTrue(getResponseStatus(result) == 400); } - @Test - public void testAssignRolesFailueWithoutOrgId() { - Result result = - performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, false, true, role)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testAssignRolesFailueWithoutUserId() { - Result result = - performTest("/v1/user/assign/role", "POST", createUserRoleRequest(false, true, true, role)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testAssignRolesFailureWithoutRoles() { - Result result = - performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, true, false, null)); - - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } - - @Test - public void testUpdateAssignedRolesFailureWithEmptyRole() { - Result result = - performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, true, true, null)); - assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); - assertTrue(getResponseStatus(result) == 400); - } + //@Test + //public void testAssignRolesFailueWithoutOrgId() { + // Result result = + // performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, false, true, role)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testAssignRolesFailueWithoutUserId() { + // Result result = + // performTest("/v1/user/assign/role", "POST", createUserRoleRequest(false, true, true, role)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testAssignRolesFailureWithoutRoles() { + // Result result = + // performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, true, false, null)); + + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} + + //@Test + //public void testUpdateAssignedRolesFailureWithEmptyRole() { + // Result result = + // performTest("/v1/user/assign/role", "POST", createUserRoleRequest(true, true, true, null)); + // assertEquals(getResponseCode(result), ResponseCode.CLIENT_ERROR.name()); + // assertTrue(getResponseStatus(result) == 400); + //} @Test public void testGetAllRolesSuccess() { diff --git a/helm/learner_opa_policies/service-policies/policies_test.rego b/helm/learner_opa_policies/service-policies/policies_test.rego index d3ab7c4913..94ef1bedcf 100644 --- a/helm/learner_opa_policies/service-policies/policies_test.rego +++ b/helm/learner_opa_policies/service-policies/policies_test.rego @@ -487,19 +487,19 @@ test_get_user_feed { } } -test_get_user_feed_create { - data.main.allow.allowed - with input as - { - "attributes": { - "request": { - "http": { - "path": "/v1/user/feed/create" - } - } - } - } -} +//test_get_user_feed_create { +// data.main.allow.allowed +// with input as +// { +// "attributes": { +// "request": { +// "http": { +// "path": "/v1/user/feed/create" +// } +// } +// } +// } +//} test_get_user_feed_delete { @@ -752,65 +752,65 @@ test_search_managed_user_without_for_token { } } -test_read_user_consent_as_public_user { - data.main.allow.allowed - with data.common.current_time as current_time - with data.common.iss as iss - with input as - { - "attributes": { - "request": { - "http": { - "headers": { - "x-authenticated-user-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL3N1bmJpcmRlZC5vcmcvYXV0aC9yZWFsbXMvc3VuYmlyZCIsInN1YiI6ImY6NWJiNmM4N2MtN2M4OC00ZDJiLWFmN2UtNTM0YTJmZWY5NzhkOjI4YjBkMDhmLWMyZWEtNDBkMS1iY2QwLThhZTAwZmNhNjZiZSIsInJvbGVzIjpbeyJyb2xlIjoiQk9PS19DUkVBVE9SIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJDT05URU5UX1JFVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM2OTg3ODc5NzUwMzY5MjgxMCJ9XX0seyJyb2xlIjoiUFJPR1JBTV9ERVNJR05FUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJSRVBPUlRfVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6Ik9SR19BRE1JTiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn0seyJvcmdhbmlzYXRpb25JZCI6IjAxNDcxOTIzNTY3ODEyMzQ1Njc4In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJuYW1lIjoiZGVtbyIsInR5cCI6IkJlYXJlciIsImV4cCI6MTY0MDIzNjEwMiwiaWF0IjoxNjQwMTQ5NzA1fQ.B3-TSdYSOlawPHjFdiRjXwvRbYQ_eH_HTiLKlH7vGS0rCOJ6HQbYyWOhZ7vbZPb3virkuyfhykFcYCEHBCkHY-fwGAeU58Pmhi0dnNJkR59Fa9y_75W98JXZW68HROp62ntEAKCA1oot_U4tYi-8UNoR17Gszj9iYzFEBc6TZA4Lrom_9gqhBOYzL0ISFWSS6oG94EaaKDYHyWzCSjU2nYRB_fn-tODmnVJ12GRJAc1oM9y54o8neNYsl4T_xPyD34v-CinUJM8jzDjFqK5_O3HnAbcmXvkZjFRgfk4mF1V4s5hlsTJGyhi2JOPh90C5N-HbAY8QsPBnzgYFQU_sww" - }, - "path": "/v1/user/consent/read" - } - } - }, - "parsed_body": { - "request": { - "consent": { - "filters": { - "userId": "28b0d08f-c2ea-40d1-bcd0-8ae00fca66be", - "consumerId": "0126632859575746566", - "objectId": "0126632859575746566" - } - } - } - } - } -} - -test_read_user_consent_as_org_admin { - data.main.allow.allowed - with data.common.current_time as current_time - with data.common.iss as iss - with input as - { - "attributes": { - "request": { - "http": { - "headers": { - "x-authenticated-user-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL3N1bmJpcmRlZC5vcmcvYXV0aC9yZWFsbXMvc3VuYmlyZCIsInN1YiI6ImY6NWJiNmM4N2MtN2M4OC00ZDJiLWFmN2UtNTM0YTJmZWY5NzhkOjI4YjBkMDhmLWMyZWEtNDBkMS1iY2QwLThhZTAwZmNhNjZiZSIsInJvbGVzIjpbeyJyb2xlIjoiQk9PS19DUkVBVE9SIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJDT05URU5UX1JFVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM2OTg3ODc5NzUwMzY5MjgxMCJ9XX0seyJyb2xlIjoiUFJPR1JBTV9ERVNJR05FUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJSRVBPUlRfVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6Ik9SR19BRE1JTiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn0seyJvcmdhbmlzYXRpb25JZCI6IjAxNDcxOTIzNTY3ODEyMzQ1Njc4In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJuYW1lIjoiZGVtbyIsInR5cCI6IkJlYXJlciIsImV4cCI6MTY0MDIzNjEwMiwiaWF0IjoxNjQwMTQ5NzA1fQ.B3-TSdYSOlawPHjFdiRjXwvRbYQ_eH_HTiLKlH7vGS0rCOJ6HQbYyWOhZ7vbZPb3virkuyfhykFcYCEHBCkHY-fwGAeU58Pmhi0dnNJkR59Fa9y_75W98JXZW68HROp62ntEAKCA1oot_U4tYi-8UNoR17Gszj9iYzFEBc6TZA4Lrom_9gqhBOYzL0ISFWSS6oG94EaaKDYHyWzCSjU2nYRB_fn-tODmnVJ12GRJAc1oM9y54o8neNYsl4T_xPyD34v-CinUJM8jzDjFqK5_O3HnAbcmXvkZjFRgfk4mF1V4s5hlsTJGyhi2JOPh90C5N-HbAY8QsPBnzgYFQU_sww" - }, - "path": "/v1/user/consent/read" - } - } - }, - "parsed_body": { - "request": { - "consent": { - "filters": { - "userId": "81c28eac-bf0f-11ec-8e6f-4f07103b952d", - "consumerId": "0126632859575746566", - "objectId": "0126632859575746566" - } - } - } - } - } -} +//test_read_user_consent_as_public_user { +// data.main.allow.allowed +// with data.common.current_time as current_time +// with data.common.iss as iss +// with input as +// { +// "attributes": { +// "request": { +// "http": { +// "headers": { +// "x-authenticated-user-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL3N1bmJpcmRlZC5vcmcvYXV0aC9yZWFsbXMvc3VuYmlyZCIsInN1YiI6ImY6NWJiNmM4N2MtN2M4OC00ZDJiLWFmN2UtNTM0YTJmZWY5NzhkOjI4YjBkMDhmLWMyZWEtNDBkMS1iY2QwLThhZTAwZmNhNjZiZSIsInJvbGVzIjpbeyJyb2xlIjoiQk9PS19DUkVBVE9SIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJDT05URU5UX1JFVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM2OTg3ODc5NzUwMzY5MjgxMCJ9XX0seyJyb2xlIjoiUFJPR1JBTV9ERVNJR05FUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJSRVBPUlRfVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6Ik9SR19BRE1JTiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn0seyJvcmdhbmlzYXRpb25JZCI6IjAxNDcxOTIzNTY3ODEyMzQ1Njc4In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJuYW1lIjoiZGVtbyIsInR5cCI6IkJlYXJlciIsImV4cCI6MTY0MDIzNjEwMiwiaWF0IjoxNjQwMTQ5NzA1fQ.B3-TSdYSOlawPHjFdiRjXwvRbYQ_eH_HTiLKlH7vGS0rCOJ6HQbYyWOhZ7vbZPb3virkuyfhykFcYCEHBCkHY-fwGAeU58Pmhi0dnNJkR59Fa9y_75W98JXZW68HROp62ntEAKCA1oot_U4tYi-8UNoR17Gszj9iYzFEBc6TZA4Lrom_9gqhBOYzL0ISFWSS6oG94EaaKDYHyWzCSjU2nYRB_fn-tODmnVJ12GRJAc1oM9y54o8neNYsl4T_xPyD34v-CinUJM8jzDjFqK5_O3HnAbcmXvkZjFRgfk4mF1V4s5hlsTJGyhi2JOPh90C5N-HbAY8QsPBnzgYFQU_sww" +// }, +// "path": "/v1/user/consent/read" +// } +// } +// }, +// "parsed_body": { +// "request": { +// "consent": { +// "filters": { +// "userId": "28b0d08f-c2ea-40d1-bcd0-8ae00fca66be", +// "consumerId": "0126632859575746566", +// "objectId": "0126632859575746566" +// } +// } +// } +// } +// } +//} + +//test_read_user_consent_as_org_admin { +// data.main.allow.allowed +// with data.common.current_time as current_time +// with data.common.iss as iss +// with input as +// { +// "attributes": { +// "request": { +// "http": { +// "headers": { +// "x-authenticated-user-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6ImFjY2Vzc3YxX2tleTEifQ.eyJhdWQiOiJodHRwczovL3N1bmJpcmRlZC5vcmcvYXV0aC9yZWFsbXMvc3VuYmlyZCIsInN1YiI6ImY6NWJiNmM4N2MtN2M4OC00ZDJiLWFmN2UtNTM0YTJmZWY5NzhkOjI4YjBkMDhmLWMyZWEtNDBkMS1iY2QwLThhZTAwZmNhNjZiZSIsInJvbGVzIjpbeyJyb2xlIjoiQk9PS19DUkVBVE9SIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPTlRFTlRfQ1JFQVRPUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJDT05URU5UX1JFVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6IkNPVVJTRV9NRU5UT1IiLCJzY29wZSI6W3sib3JnYW5pc2F0aW9uSWQiOiIwMTM2OTg3ODc5NzUwMzY5MjgxMCJ9XX0seyJyb2xlIjoiUFJPR1JBTV9ERVNJR05FUiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn1dfSx7InJvbGUiOiJSRVBPUlRfVklFV0VSIiwic2NvcGUiOlt7Im9yZ2FuaXNhdGlvbklkIjoiMDEzNjk4Nzg3OTc1MDM2OTI4MTAifV19LHsicm9sZSI6Ik9SR19BRE1JTiIsInNjb3BlIjpbeyJvcmdhbmlzYXRpb25JZCI6IjAxMzY5ODc4Nzk3NTAzNjkyODEwIn0seyJvcmdhbmlzYXRpb25JZCI6IjAxNDcxOTIzNTY3ODEyMzQ1Njc4In1dfSx7InJvbGUiOiJQVUJMSUMiLCJzY29wZSI6W119XSwiaXNzIjoiaHR0cHM6Ly9zdW5iaXJkZWQub3JnL2F1dGgvcmVhbG1zL3N1bmJpcmQiLCJuYW1lIjoiZGVtbyIsInR5cCI6IkJlYXJlciIsImV4cCI6MTY0MDIzNjEwMiwiaWF0IjoxNjQwMTQ5NzA1fQ.B3-TSdYSOlawPHjFdiRjXwvRbYQ_eH_HTiLKlH7vGS0rCOJ6HQbYyWOhZ7vbZPb3virkuyfhykFcYCEHBCkHY-fwGAeU58Pmhi0dnNJkR59Fa9y_75W98JXZW68HROp62ntEAKCA1oot_U4tYi-8UNoR17Gszj9iYzFEBc6TZA4Lrom_9gqhBOYzL0ISFWSS6oG94EaaKDYHyWzCSjU2nYRB_fn-tODmnVJ12GRJAc1oM9y54o8neNYsl4T_xPyD34v-CinUJM8jzDjFqK5_O3HnAbcmXvkZjFRgfk4mF1V4s5hlsTJGyhi2JOPh90C5N-HbAY8QsPBnzgYFQU_sww" +// }, +// "path": "/v1/user/consent/read" +// } +// } +// }, +// "parsed_body": { +// "request": { +// "consent": { +// "filters": { +// "userId": "81c28eac-bf0f-11ec-8e6f-4f07103b952d", +// "consumerId": "0126632859575746566", +// "objectId": "0126632859575746566" +// } +// } +// } +// } +// } +//} test_update_user_consent { data.main.allow.allowed