aboutsummaryrefslogtreecommitdiffstats
path: root/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
diff options
context:
space:
mode:
Diffstat (limited to 'policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java')
-rw-r--r--policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java b/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
index fbd81391..d8257067 100644
--- a/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
+++ b/policy-core/src/test/java/org/onap/policy/drools/core/PolicySessionFeatureApiMock.java
@@ -3,6 +3,7 @@
* policy-core
* ================================================================================
* Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +22,7 @@
package org.onap.policy.drools.core;
import java.util.ArrayList;
+import lombok.Setter;
import org.kie.api.runtime.KieSession;
/**
@@ -30,10 +32,11 @@ import org.kie.api.runtime.KieSession;
*/
public class PolicySessionFeatureApiMock implements PolicySessionFeatureApi {
// contains the log entries since the most recent 'getLog()' call
- private static ArrayList<String> log = new ArrayList<>();
+ private static final ArrayList<String> log = new ArrayList<>();
// if 'true', trigger an exception right after doing the log,
// to verify that exceptions are handled
+ @Setter
private static boolean exceptionTrigger = false;
/**
@@ -50,17 +53,6 @@ public class PolicySessionFeatureApiMock implements PolicySessionFeatureApi {
}
/**
- * This method controls whether these hooks trigger an exception after
- * being invoked.
- *
- * @param indicator if 'true', subsequent hook method calls will trigger
- * an exception; if 'false', no exception is triggered
- */
- public static void setExceptionTrigger(boolean indicator) {
- exceptionTrigger = indicator;
- }
-
- /**
* This method adds an entry to the log, and possibly triggers an exception.
*
* @param arg value to add to the log