Skip to content

Commit

Permalink
[KOGITO-9145] - Fixed sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
VaniHaripriya committed Aug 11, 2023
1 parent c409a15 commit 045b847
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,41 @@

import javax.inject.Inject;

import org.eclipse.microprofile.config.Config;
import org.junit.jupiter.api.Test;
import org.kie.kogito.addons.k8s.resource.catalog.KubernetesProtocol;
import org.kie.kogito.addons.k8s.resource.catalog.KubernetesServiceCatalogKey;
import org.kie.kogito.addons.k8s.resource.catalog.KubernetesServiceCatalogTest;

import io.quarkus.test.junit.QuarkusTest;

import static org.junit.jupiter.api.Assertions.assertThrows;

@QuarkusTest
public class MicroProfileConfigServiceCatalogTest extends KubernetesServiceCatalogTest {

private static final String KUBERNETES_SERVICENAME = "serverless-workflow-greeting-quarkus-kubernetes";

private static final String NAMESPACE = "test";

private static final String NAMESPACE_KUBERNETES_SERVICENAME = NAMESPACE + '/' + KUBERNETES_SERVICENAME;

@Inject
MicroProfileConfigServiceCatalog configServiceCatalog;

@Inject
Config config;

@Inject
MicroProfileConfigServiceCatalogTest(MicroProfileConfigServiceCatalog configServiceCatalog) {
super(configServiceCatalog);
}

@Test
public void testGetServiceAddressWithInvalidURI() {
KubernetesServiceCatalogKey key = new KubernetesServiceCatalogKey(KubernetesProtocol.KUBERNETES, NAMESPACE_KUBERNETES_SERVICENAME);

assertThrows(RuntimeException.class, () -> configServiceCatalog.getServiceAddress(key));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ knative\:services.v1.serving.knative.dev\/test\/serverless-workflow-greeting-qua

kubernetes\:services.v1.serving.knative.dev\/serverless-workflow-greeting-quarkus-kubernetes = http\:\/\/serverless-workflow-greeting-quarkus-kubernetes.test.10.99.154.147.sslip.io
kubernetes\:services.v1.serving.knative.dev\/test\/serverless-workflow-greeting-quarkus-kubernetes = http\:\/\/serverless-workflow-greeting-quarkus-kubernetes.test.10.99.154.147.sslip.io
kubernetes\:test\/serverless-workflow-greeting-quarkus-kubernetes = "invalid-uri"

openshift\:services.v1.serving.knative.dev\/serverless-workflow-greeting-quarkus-openshift = http\:\/\/serverless-workflow-greeting-quarkus-openshift.test.10.99.154.147.sslip.io
openshift\:services.v1.serving.knative.dev\/test\/serverless-workflow-greeting-quarkus-openshift = http\:\/\/serverless-workflow-greeting-quarkus-openshift.test.10.99.154.147.sslip.io

0 comments on commit 045b847

Please sign in to comment.