Change config to add Application group
[policy/xacml-pdp.git] / main / src / test / java / org / onap / policy / pdpx / main / rest / TestDecision.java
index 6f7dec6..5f6a279 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -52,7 +52,6 @@ import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
-import org.onap.policy.common.gson.GsonMessageBodyHandler;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.common.utils.resources.ResourceUtils;
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
@@ -60,6 +59,7 @@ import org.onap.policy.models.decisions.concepts.DecisionResponse;
 import org.onap.policy.models.errors.concepts.ErrorResponse;
 import org.onap.policy.pdpx.main.PolicyXacmlPdpException;
 import org.onap.policy.pdpx.main.parameters.CommonTestData;
+import org.onap.policy.pdpx.main.parameters.XacmlApplicationParameters;
 import org.onap.policy.pdpx.main.parameters.XacmlPdpParameterGroup;
 import org.onap.policy.pdpx.main.startstop.Main;
 import org.onap.policy.pdpx.main.startstop.XacmlPdpActivator;
@@ -105,13 +105,16 @@ public class TestDecision {
         //
         RestServerParameters rest =
             testData.toObject(testData.getRestServerParametersMap(port), RestServerParameters.class);
-        RestServerParameters policyApiParameters =
-                        testData.toObject(testData.getPolicyApiParametersMap(false), RestServerParameters.class);
+        BusTopicParams policyApiParameters =
+                        testData.toObject(testData.getPolicyApiParametersMap(false), BusTopicParams.class);
         TopicParameterGroup topicParameterGroup =
                         testData.toObject(testData.getTopicParametersMap(false), TopicParameterGroup.class);
+        final XacmlApplicationParameters xacmlApplicationParameters =
+                testData.toObject(testData.getXacmlapplicationParametersMap(false,
+                        apps.getAbsolutePath().toString()), XacmlApplicationParameters.class);
         XacmlPdpParameterGroup params =
-                new XacmlPdpParameterGroup("XacmlPdpParameters", "XacmlPdpGroup", rest, policyApiParameters,
-                        topicParameterGroup, apps.getAbsolutePath());
+                new XacmlPdpParameterGroup("XacmlPdpParameters", "XacmlPdpGroup", "xacml", rest, policyApiParameters,
+                        topicParameterGroup, xacmlApplicationParameters);
         final Gson gson = new GsonBuilder().create();
         File fileParams = appsFolder.newFile("params.json");
         String jsonParams = gson.toJson(params);
@@ -244,7 +247,6 @@ public class TestDecision {
     private static HttpClient getNoAuthHttpClient() throws HttpClientConfigException {
         return HttpClientFactoryInstance.getClientFactory().build(BusTopicParams.builder()
                 .clientName("testDecisionClient")
-                .serializationProvider(GsonMessageBodyHandler.class.getName())
                 .useHttps(false).allowSelfSignedCerts(false).hostname("localhost").port(port)
                 .basePath("policy/pdpx/v1")
                 .userName("healthcheck").password("zb!XztG34").managed(true).build());