-
Notifications
You must be signed in to change notification settings - Fork 729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DCR integration tests #18491
base: master
Are you sure you want to change the base?
Add DCR integration tests #18491
Conversation
(cherry picked from commit 2bc0385)
(cherry picked from commit 644168e)
(cherry picked from commit a446658)
(cherry picked from commit 1cdda47)
(cherry picked from commit 1da018c)
(cherry picked from commit 9907c3c)
(cherry picked from commit cffe18a)
(cherry picked from commit f4e163c)
(cherry picked from commit 569b399)
(cherry picked from commit eb249c0)
(cherry picked from commit d22d6bf)
(cherry picked from commit 95871e0)
PR builder started |
PR builder completed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/7138883250
@@ -0,0 +1,191 @@ | |||
/* | |||
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the license header, I think latest one should be
/**
* Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com/).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mail: License Header for WSO2 code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -98,7 +98,7 @@ private static Object[][] dcrConfigProvider() throws Exception { | |||
getRegisterRequestJSON("request2.json"), getUpdateRequestJSON("request2.json"), ADMIN_USERNAME, | |||
ADMIN_PASSWORD, SUPER_TENANT_DOMAIN | |||
} | |||
}; | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
@@ -121,8 +118,8 @@ public void testCreateServiceProviderRequest() throws IOException { | |||
@Test(alwaysRun = true, groups = "wso2.is", priority = 2, description = | |||
"Create a service provider with already registered client name") | |||
public void testCreateServiceProviderRequestWithExistingClientName() throws IOException { | |||
HttpPost request = new HttpPost(getPath()); | |||
request.addHeader(HttpHeaders.AUTHORIZATION, getAuthzHeader()); | |||
HttpPost request = new HttpPost(DCRUtils.getPath(tenant)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a new line after method signature, please check other places too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
@@ -74,18 +74,15 @@ public OAuthDCRMTestCase(TestUserMode userMode) throws Exception { | |||
public static Object[][] dcrmConfigProvider() { | |||
return new Object[][]{{TestUserMode.SUPER_TENANT_ADMIN}, {TestUserMode.TENANT_ADMIN}}; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this seperator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
} | ||
public static String getAuthzHeader(String username, String password) { | ||
|
||
return "Basic " + Base64.encodeBase64String((username + ":" + password).getBytes()).trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use a constant
ref:
Line 92 in dfab6bb
public static final String BASIC_HEADER = "Basic"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
request.addHeader(HttpHeaders.CONTENT_TYPE, OAuthDCRMConstants.CONTENT_TYPE); | ||
} | ||
|
||
public static String getPath(String tenant) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we reuse following Util method?
Line 159 in ab7c8ef
public String getTenantQualifiedURL(String endpointURL, String tenantDomain) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
PR builder started |
@@ -0,0 +1,94 @@ | |||
/* | |||
* Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
PR builder completed |
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
PR builder started |
PR builder completed |
No description provided.