-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(config-api): asset upload config and saml document store changes (#…
…10734) * feat(config-api): testng framework changes Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework - wip Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework wip Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework wip Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework wip Signed-off-by: pujavs <[email protected]> * feat(config-api): sync with main Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api) testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framework Signed-off-by: pujavs <[email protected]> * feat(config-api): testng framwork Signed-off-by: pujavs <[email protected]> --------- Signed-off-by: pujavs <[email protected]>
- Loading branch information
Showing
263 changed files
with
4,311 additions
and
2,816 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...-api/plugins/admin-ui-plugin/src/test/java/io/jans/ca/plugin/adminui/AdminUIBaseTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. | ||
* | ||
* Copyright (c) 2020, Janssen Project | ||
*/ | ||
|
||
package io.jans.ca.plugin.adminui; | ||
|
||
import io.jans.configapi.core.test.BaseTest; | ||
|
||
import java.io.UnsupportedEncodingException; | ||
import java.util.Map; | ||
import java.util.HashMap; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.apache.http.entity.ContentType; | ||
import org.testng.SkipException; | ||
import org.testng.annotations.BeforeMethod; | ||
|
||
public class AdminUIBaseTest extends BaseTest { | ||
|
||
// Execute before each test is run | ||
@BeforeMethod | ||
protected void before() { | ||
boolean isAvailable = isEndpointAvailable(propertiesMap.get("auditLoggingURL"), accessToken); | ||
log.error("\n\n\n *********************** ADMIN-UI Plugin isAvailable:{} {}", isAvailable, "\n\n\n"); | ||
// check condition, note once you condition is met the rest of the tests will be | ||
|
||
// skipped as well | ||
if (!isAvailable) { | ||
throw new SkipException("ADMIN-UI Plugin Not deployed"); | ||
} else { | ||
log.info("\n\n\n *** ADMIN-UI Plugin is Deployed {}", "\n\n"); | ||
} | ||
} | ||
|
||
public void authorize() { | ||
log.info("AdminUI - getAccessToken - propertiesMap:{}", propertiesMap); | ||
|
||
String authzurl = propertiesMap.get("test.authzurl"); | ||
String strGrantType = propertiesMap.get("test.grant.type"); | ||
String clientId = propertiesMap.get("test.client.id"); | ||
String clientSecret = propertiesMap.get("test.client.secret"); | ||
String scopes = propertiesMap.get("test.scopes"); | ||
String responseType = propertiesMap.get("test.response.type"); | ||
String redirectUri = propertiesMap.get("test.redirect.uri"); | ||
log.info( | ||
"\n\n\n\n ************ AdminUI- authzurl:{}, strGrantType:{}, clientId:{}, clientSecret:{}, scopes:{}, responseType:{}, propertiesMap.get(auditLoggingURL)", | ||
authzurl, strGrantType, clientId, clientSecret, scopes, responseType, | ||
propertiesMap.get("auditLoggingURL")); | ||
Map<String, String> params = new HashMap<>(); | ||
params.put("client_id", clientId); | ||
params.put("scope", scopes); | ||
params.put("grant_type", strGrantType); | ||
params.put("response_type", responseType); | ||
params.put("redirect_uri", redirectUri); | ||
Response response = authorize(authzurl, clientId, clientSecret, null, getAuthCode(clientId, clientSecret), | ||
params, null); | ||
log.info("\n\n\n\n AdminUI- response:{} :{}", response, "**********"); | ||
} | ||
|
||
private String getAuthCode(final String clientId, final String clientSecret) { | ||
String code = null; | ||
try { | ||
code = getCredentials(clientId, clientSecret); | ||
} catch (UnsupportedEncodingException ex) { | ||
log.error("Error while encoding credentials is ", ex); | ||
} | ||
return code; | ||
} | ||
|
||
private Response authorize(final String authzurl, final Map<String, String> parameters, | ||
ContentType contentType) { | ||
return executePost(authzurl, clientId, clientSecret, authType, authCode, parameters, contentType); | ||
} | ||
|
||
} |
19 changes: 0 additions & 19 deletions
19
...api/plugins/admin-ui-plugin/src/test/java/io/jans/ca/plugin/adminui/KarateTestRunner.java
This file was deleted.
Oops, something went wrong.
43 changes: 0 additions & 43 deletions
43
...min-ui-plugin/src/test/java/io/jans/ca/plugin/adminui/TestAdminUIPluginJenkinsRunner.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
...dmin-ui-plugin/src/test/java/io/jans/ca/plugin/adminui/test/AuditLoggingResourceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. | ||
* | ||
* Copyright (c) 2020, Janssen Project | ||
*/ | ||
|
||
package io.jans.ca.plugin.adminui.test; | ||
|
||
import io.jans.ca.plugin.adminui.AdminUIBaseTest; | ||
|
||
import jakarta.ws.rs.client.Entity; | ||
import jakarta.ws.rs.client.Invocation.Builder; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import jakarta.ws.rs.core.Response.Status; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
|
||
import org.testng.annotations.Parameters; | ||
import org.testng.annotations.Test; | ||
|
||
public class AuditLoggingResourceTest extends AdminUIBaseTest { | ||
|
||
/** | ||
* Testing Audit Logging endpoint | ||
*/ | ||
@Parameters({ "test.issuer", "auditLoggingURL", "audit_post_1" }) | ||
@Test | ||
public void postAuditLoggingData(final String issuer, final String auditLoggingURL, final String json) { | ||
log.info("\n\n postAuditLoggingData() - accessToken:{}, issuer:{}, auditLoggingURL:{}, json:{}", accessToken, | ||
issuer, auditLoggingURL, json); | ||
|
||
Builder request = getResteasyService().getClientBuilder(issuer + auditLoggingURL); | ||
request.header(AUTHORIZATION, AUTHORIZATION_TYPE + " " + accessToken); | ||
request.header(CONTENT_TYPE, MediaType.APPLICATION_JSON); | ||
|
||
Response response = request.post(Entity.entity(json, MediaType.APPLICATION_JSON)); | ||
assertEquals(response.getStatus(), Status.OK.getStatusCode()); | ||
log.info("\n\n Response for postAuditLoggingData - response:{}, response.getStatus():{}", response, | ||
response.getStatus()); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.