* ============LICENSE_START=======================================================
* ONAP
* ================================================================================
- * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 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.assertj.core.api.Assertions.assertThat;
import com.att.research.xacml.api.Response;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.Persistence;
import java.io.File;
import java.io.IOException;
import java.time.Instant;
import java.util.Properties;
import java.util.ServiceLoader;
import java.util.UUID;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Persistence;
-
import org.apache.commons.lang3.tuple.Pair;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runners.MethodSorters;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.TextFileUtils;
+import org.onap.policy.guard.OperationsHistory;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
import org.onap.policy.models.decisions.concepts.DecisionResponse;
import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
import org.onap.policy.pdp.xacml.application.common.XacmlApplicationServiceProvider;
import org.onap.policy.pdp.xacml.application.common.XacmlPolicyUtils;
import org.onap.policy.pdp.xacml.application.common.operationshistory.CountRecentOperationsPip;
-import org.onap.policy.pdp.xacml.application.common.operationshistory.Dbao;
import org.onap.policy.pdp.xacml.xacmltest.TestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOGGER = LoggerFactory.getLogger(SonCoordinationTest.class);
private static Properties properties = new Properties();
private static File propertiesFile;
- private static RestServerParameters clientParams = new RestServerParameters();
private static XacmlApplicationServiceProvider service;
private static DecisionRequest requestVpciNode1;
private static DecisionRequest requestVsonhNode1;
// Tell it to initialize based on the properties file
// we just built for it.
//
- service.initialize(propertiesFile.toPath().getParent(), clientParams);
+ service.initialize(propertiesFile.toPath().getParent(), null);
//
// Load Decision Requests
//
@Before
public void startClean() throws Exception {
em.getTransaction().begin();
- em.createQuery("DELETE FROM Dbao").executeUpdate();
+ em.createQuery("DELETE FROM OperationsHistory").executeUpdate();
em.getTransaction().commit();
}
//
// Add an entry
//
- Dbao newEntry = new Dbao();
+ OperationsHistory newEntry = new OperationsHistory();
newEntry.setActor(properties.get("actor").toString());
newEntry.setOperation(properties.get("operation").toString());
newEntry.setClosedLoopName(properties.get("clname").toString());
private void updateOperationEvent(long id, String outcome) {
- Dbao updateEntry = em.find(Dbao.class, id);
+ OperationsHistory updateEntry = em.find(OperationsHistory.class, id);
updateEntry.setOutcome(outcome);
updateEntry.setEndtime(Date.from(Instant.now()));
em.getTransaction().begin();