Skip to content

Commit

Permalink
Merge pull request #22268 from madurangasiriwardena/test3
Browse files Browse the repository at this point in the history
Add logs to identify RegistryMountTestCase test failure reason
  • Loading branch information
madurangasiriwardena authored Jan 16, 2025
2 parents 79353a6 + 3e59749 commit a1b5118
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public String createApplication(ApplicationModel application) throws IOException

try (CloseableHttpResponse response = getResponseOfHttpPost(applicationManagementApiBasePath, jsonRequest,
getHeaders())) {

if (response.getStatusLine().getStatusCode() >= 400) {
String responseBody = EntityUtils.toString(response.getEntity());
throw new RuntimeException("Error occurred while creating the application. Response: " + responseBody);
}
String[] locationElements = response.getHeaders(LOCATION_HEADER)[0].toString().split(PATH_SEPARATOR);
return locationElements[locationElements.length - 1];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private Tenant getRegistryMountTenantInfo() {
return registryMountTenant;
}

private void createApplication() throws Exception{
private void createApplication() throws Exception {

ApplicationModel applicationCreationModel = new ApplicationModel()
.name(APPLICATION_NAME)
Expand All @@ -294,7 +294,12 @@ private void createApplication() throws Exception{
.saml(getSAMLConfigurations()))
.claimConfiguration(getClaimConfiguration());

appId = applicationMgtRestClient.createApplication(applicationCreationModel);
try {
appId = applicationMgtRestClient.createApplication(applicationCreationModel);
} catch (RuntimeException e) {
log.error("Error while creating the application", e);
throw new Exception("Error while creating the application", e);
}
}

private void deleteApplication() throws Exception{
Expand Down

0 comments on commit a1b5118

Please sign in to comment.