Skip to content

Commit

Permalink
Merge pull request #522 from bf2fc6cc711aee1a0c2a/service-reg-exceptions
Browse files Browse the repository at this point in the history
addition of case for creation of service registry exception
  • Loading branch information
henryZrncik authored Apr 3, 2023
2 parents 16c03e7 + e465a51 commit 842d3c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ protected ApiGenericException toApiException(Exception e) {

if (e.getCause() != null) {
log.info(e);
if (e.getCause() instanceof com.openshift.cloud.api.srs.models.Error) {
var err = (com.openshift.cloud.api.srs.models.Error) e.getCause();
return new ApiGenericException(err.getReason(), err.getCode(), err.responseStatusCode, err.getHref(), err.getId(), err);
}
if (e.getCause() instanceof com.microsoft.kiota.ApiException) {
var err = (com.microsoft.kiota.ApiException) e.getCause();
return new ApiGenericException(err.getMessage(), "", err.responseStatusCode, "", "", err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ public void testDeleteRegistry() throws Throwable {
public void testDeleteProvisioningRegistry() throws Throwable {

var registryCreateRest = new RegistryCreate();
registryCreateRest.setName(SERVICE_REGISTRY_NAME);
registryCreateRest.setName(SERVICE_REGISTRY_2_NAME);

LOGGER.info("create kafka instance: {}", SERVICE_REGISTRY_2_NAME);
LOGGER.info("create service registry instance: {}", SERVICE_REGISTRY_2_NAME);
var registryToDelete = registryMgmtApi.createRegistry(registryCreateRest);

LOGGER.info("delete the registry: {}", registryToDelete.getId());
Expand Down

0 comments on commit 842d3c8

Please sign in to comment.