summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-kubernetes/src/test/java
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2022-08-29 10:15:45 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2022-11-03 09:11:01 +0000
commita01b2d8fa0e6ed8138b0edf85964d70b5c08fa92 (patch)
treebc87c5be474c766312d8b0af12290603479bbb9f /participant/participant-impl/participant-impl-kubernetes/src/test/java
parentcbf36339b5740bfe2dc3f23a26d31d5d5c56eedb (diff)
Add Prometheus metric messages for ACM participants
Issue-ID: POLICY-4433 Change-Id: I625c9ee26bb2451e0dcfbb4bbf7288dcc0effb50 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-kubernetes/src/test/java')
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/rest/ChartControllerTest.java4
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/utils/CommonActuatorController.java7
2 files changed, 7 insertions, 4 deletions
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/rest/ChartControllerTest.java b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/rest/ChartControllerTest.java
index c57684fd7..e1cf3cf08 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/rest/ChartControllerTest.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/rest/ChartControllerTest.java
@@ -49,9 +49,12 @@ import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;
+import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.context.annotation.Import;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@@ -64,6 +67,7 @@ import org.springframework.web.context.WebApplicationContext;
@ExtendWith(SpringExtension.class)
@WebMvcTest(value = ChartController.class, properties = "chart.api.enabled=true")
+@Import({MetricsAutoConfiguration.class, CompositeMeterRegistryAutoConfiguration.class})
@EnableConfigurationProperties(value = ParticipantK8sParameters.class)
class ChartControllerTest {
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/utils/CommonActuatorController.java b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/utils/CommonActuatorController.java
index 8b716a5fd..23f591f0f 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/utils/CommonActuatorController.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/utils/CommonActuatorController.java
@@ -40,8 +40,7 @@ import org.onap.policy.common.utils.network.NetworkUtil;
public class CommonActuatorController {
public static final String SELF = NetworkUtil.getHostname();
- public static final String CONTEXT_PATH = "onap/policy/clamp/acm/k8sparticipant";
- public static final String ACTUATOR_ENDPOINT = CONTEXT_PATH + "/actuator/";
+ public static final String CONTEXT_PATH = "onap/policy/clamp/acm/k8sparticipant/";
private static String httpPrefix;
@@ -52,7 +51,7 @@ public class CommonActuatorController {
* @return a request builder
*/
protected Invocation.Builder sendActRequest(final String endpoint) {
- return sendFqeRequest(httpPrefix + ACTUATOR_ENDPOINT + endpoint, true);
+ return sendFqeRequest(httpPrefix + CONTEXT_PATH + endpoint, true);
}
/**
@@ -62,7 +61,7 @@ public class CommonActuatorController {
* @return a request builder
*/
protected Invocation.Builder sendNoAuthActRequest(final String endpoint) {
- return sendFqeRequest(httpPrefix + ACTUATOR_ENDPOINT + endpoint, false);
+ return sendFqeRequest(httpPrefix + CONTEXT_PATH + endpoint, false);
}
/**