* Sets data in Keys for the tests.
*/
@BeforeAll
- public static void setUp() {
+ static void setUp() {
someKey = new MyKey();
someKey0 = new MyKey();
* Closes the DAO.
*/
@AfterAll
- public static void tearDown() {
+ static void tearDown() {
if (pfDao != null) {
pfDao.close();
pfDao = null;
import org.onap.policy.common.utils.network.NetworkUtil;
@Path("RestTest")
-public class RestTest {
+public class RestTest { // NOSONAR - class needs to be public for Jersey to work
private static final String MERGE_PATCH_PLUS_JSON = "application/merge-patch+json";
private static final String NAME_PARAM = "Bob";
* Sets server endpoint for the tests.
*/
@BeforeAll
- public static void setUp() throws Exception {
+ static void setUp() throws Exception {
port = NetworkUtil.allocPort();
baseUri = "http://" + LOCALHOST + ":" + port + "/" + BASE + "/";
*
*/
@AfterAll
- public static void tearDown() {
+ static void tearDown() {
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* Set up test class.
*/
@BeforeAll
- public static void setUpSimulator() {
+ static void setUpSimulator() {
try {
var testServer = Util.buildAaiSim();
assertNotNull(testServer);
}
@AfterAll
- public static void tearDownSimulator() {
+ static void tearDownSimulator() {
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* Sets up.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
server = new AppcLcmTopicServer(sink, source);
}
* Sets up.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
server = new AppcLegacyTopicServer(sink, source);
}
* Sets up.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
server = new SdnrTopicServer(sink, source);
}
* Set up test class.
*/
@BeforeAll
- public static void setUpSimulator() {
+ static void setUpSimulator() {
try {
var testServer = Util.buildSoSim();
assertNotNull(testServer);
}
@AfterAll
- public static void tearDownSimulator() {
+ static void tearDownSimulator() {
HttpServletServerFactoryInstance.getServerFactory().destroy();
SoSimulatorJaxRs.setRequirePolling(false);
}
* Sets up.
*/
@BeforeEach
- public void setUp() {
+ void setUp() {
server = new MyServer();
}
* Set up test class.
*/
@BeforeAll
- public static void setupSimulator() {
+ static void setupSimulator() {
try {
var testServer = Util.buildXacmlSim();
assertNotNull(testServer);
}
@AfterAll
- public static void tearDownSimulator() {
+ static void tearDownSimulator() {
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* Initialize parameters.
*/
@BeforeAll
- public static void setupParameters() {
+ static void setupParameters() {
parameters = new PolicyModelsProviderParameters();
parameters.setDatabaseDriver("org.h2.Driver");
parameters.setDatabaseUrl("jdbc:h2:mem:DatabasePolicyModelsProviderTest");
* Closes the DB.
*/
@AfterAll
- public static void tearDown() throws PfModelException {
+ static void tearDown() throws PfModelException {
if (databaseProvider != null) {
databaseProvider.close();
}
* @throws CoderException on JSON encoding and decoding errors
*/
@BeforeAll
- public static void setupParameters() throws Exception {
+ static void setupParameters() throws Exception {
PolicyModelsProviderParameters parameters = new PolicyModelsProviderParameters();
}
@AfterAll
- public static void teardown() throws Exception {
+ static void teardown() throws Exception {
databaseProvider.close();
}
* @throws PfModelException on exceptions in the tests
*/
@BeforeAll
- public static void setupParameters() throws PfModelException {
+ static void setupParameters() throws PfModelException {
PolicyModelsProviderParameters parameters = new PolicyModelsProviderParameters();
}
@AfterAll
- public static void teardown() throws Exception {
+ static void teardown() throws Exception {
databaseProvider.close();
}
private static PolicyModelsProvider databaseProvider;
@BeforeAll
- public static void beforeSetupParameters() {
+ static void beforeSetupParameters() {
parameters = new PolicyModelsProviderParameters();
parameters.setDatabaseDriver("org.h2.Driver");
parameters.setDatabaseUrl("jdbc:h2:mem:HierarchyFetchTest");
* Closes the DB.
*/
@AfterAll
- public static void tearDown() throws PfModelException {
+ static void tearDown() throws PfModelException {
if (databaseProvider != null) {
databaseProvider.close();
}
* @throws CoderException on JSON decoding errors
*/
@BeforeAll
- public static void setupTypeList() throws CoderException {
+ static void setupTypeList() throws CoderException {
for (String policyTypeResourceName : policyTypeResourceNames) {
String policyTypeString = ResourceUtils.getResourceAsString(policyTypeResourceName);
Object yamlObject = new Yaml().load(policyTypeString);
* @throws CoderException on JSON decoding errors
*/
@BeforeAll
- public static void setupTypeList() throws CoderException {
+ static void setupTypeList() throws CoderException {
for (String policyResourceName : policyResourceNames) {
String policyString = ResourceUtils.getResourceAsString(policyResourceName);
if (policyResourceName.endsWith("yaml")) {
* Read the policy type definition.
*/
@BeforeAll
- public static void readPolicyDefinition() {
+ static void readPolicyDefinition() {
String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
Object yamlObject = new Yaml().load(yamlString);
*
*/
@BeforeAll
- public static void readPolicyDefinition() {
+ static void readPolicyDefinition() {
String yamlString = ResourceUtils.getResourceAsString("src/test/resources/onap.policies.NoVersion.yaml");
Object yamlObject = new Yaml().load(yamlString);
* Initializes the properties.
*/
@BeforeAll
- public static void setUpBeforeClass() {
+ static void setUpBeforeClass() {
JPA_PROP1.setDescription(DESCRIPT1);
JPA_PROP2.setDescription(DESCRIPT2);