/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation
+ * Modifications Copyright (C) 2020,2023 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import jakarta.ws.rs.client.Entity;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Map;
import java.util.Properties;
import java.util.ServiceLoader;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.internal.JerseyClient;
+import org.onap.policy.common.endpoints.parameters.RestClientParameters;
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.pdp.xacml.xacmltest.TestUtils;
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;
private static File propertiesFile;
private static XacmlApplicationServiceProvider service;
- private static RestServerParameters policyApiParameters;
+ private static RestClientParameters policyApiParameters;
@ClassRule
public static final TemporaryFolder appsFolder = new TemporaryFolder();
// Create parameters for XacmlPdPService
RestServerParameters rest = testData.toObject(testData.getRestServerParametersMap(port),
RestServerParameters.class);
- policyApiParameters = testData.toObject(testData.getPolicyApiParametersMap(false), RestServerParameters.class);
+ policyApiParameters = testData.toObject(testData.getPolicyApiParametersMap(false), RestClientParameters.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", "xacml", rest, policyApiParameters,
- topicParameterGroup, apps.getAbsolutePath());
+ topicParameterGroup, xacmlApplicationParameters);
StandardCoder gson = new StandardCoder();
File fileParams = appsFolder.newFile("params.json");
String jsonParams = gson.encode(params);
// Start the service
//
main = startXacmlPdpService(fileParams);
- XacmlPdpActivator.getCurrent().startXacmlRestController();
+ XacmlPdpActivator.getCurrent().enableApi();
//
// Make sure it is running
//
*/
private static HttpClient getNoAuthHttpClient()
throws HttpClientConfigException, KeyManagementException, NoSuchAlgorithmException, ClassNotFoundException {
- BusTopicParams clientParams = new BusTopicParams();
+ RestClientParameters clientParams = new RestClientParameters();
clientParams.setClientName("testName");
clientParams.setUseHttps(false);
clientParams.setAllowSelfSignedCerts(false);
// Tell it to initialize based on the properties file
// we just built for it.
//
- service.initialize(propertiesFile.toPath().getParent(), policyApiParameters);
+ service.initialize(propertiesFile.toPath().getParent(), null);
}
}