diff --git a/src/test/java/org/hisp/dhis/rules/ConstantsValueTest.java b/src/test/java/org/hisp/dhis/rules/ConstantsValueTest.java index 72b69f68..238ed3f4 100644 --- a/src/test/java/org/hisp/dhis/rules/ConstantsValueTest.java +++ b/src/test/java/org/hisp/dhis/rules/ConstantsValueTest.java @@ -44,7 +44,6 @@ import org.junit.runners.JUnit4; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -110,7 +109,7 @@ public void assignValue() org.hisp.dhis.rules.models.Rule rule2 = org.hisp.dhis.rules.models.Rule .create( null, 1, "#{test_attribute} > 3", List.of(action), "test_program_rule2", "" ); - RuleEngine.Builder ruleEngineBuilder = getRuleEngine( Arrays.asList( rule, rule2 ), + RuleEngine.Builder ruleEngineBuilder = getRuleEngine( List.of( rule, rule2 ), new HashMap<>() ); RuleEnrollment enrollment = RuleEnrollment.builder() @@ -145,7 +144,7 @@ public void assignValueThroughVariable() org.hisp.dhis.rules.models.Rule rule2 = org.hisp.dhis.rules.models.Rule .create( null, 1, "#{test_attribute} > 3", List.of(action), "test_program_rule2", "" ); - RuleEngine.Builder ruleEngineBuilder = getRuleEngine( Arrays.asList( rule, rule2 ), + RuleEngine.Builder ruleEngineBuilder = getRuleEngine( List.of( rule, rule2 ), new HashMap<>() ); RuleEnrollment enrollment = RuleEnrollment.builder() diff --git a/src/test/java/org/hisp/dhis/rules/ProgramRuleVariableTest.java b/src/test/java/org/hisp/dhis/rules/ProgramRuleVariableTest.java index d4e2eac5..f5ed1491 100644 --- a/src/test/java/org/hisp/dhis/rules/ProgramRuleVariableTest.java +++ b/src/test/java/org/hisp/dhis/rules/ProgramRuleVariableTest.java @@ -37,7 +37,6 @@ import org.hisp.dhis.rules.models.RuleEnrollment; import org.hisp.dhis.rules.models.RuleEvent; import org.hisp.dhis.rules.models.TriggerEnvironment; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/src/test/java/org/hisp/dhis/rules/RuleEngineContextTest.java b/src/test/java/org/hisp/dhis/rules/RuleEngineContextTest.java index 66a3c594..650951a9 100644 --- a/src/test/java/org/hisp/dhis/rules/RuleEngineContextTest.java +++ b/src/test/java/org/hisp/dhis/rules/RuleEngineContextTest.java @@ -8,7 +8,6 @@ import org.junit.runners.JUnit4; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -48,7 +47,7 @@ public void builderShouldThrowOnNullRulesList() @Test public void builderShouldContainImmutableCopyOfRules() { - List members = Arrays.asList( "one", "two" ); + List members = List.of( "one", "two" ); Map> supplementaryData = new HashMap<>(); supplementaryData.put( "text-key", members ); diff --git a/src/test/java/org/hisp/dhis/rules/RuleEngineEffectTypesTest.java b/src/test/java/org/hisp/dhis/rules/RuleEngineEffectTypesTest.java index d6f70ef3..93916176 100644 --- a/src/test/java/org/hisp/dhis/rules/RuleEngineEffectTypesTest.java +++ b/src/test/java/org/hisp/dhis/rules/RuleEngineEffectTypesTest.java @@ -4,15 +4,15 @@ import org.hisp.dhis.rules.models.RuleAction; import org.hisp.dhis.rules.models.RuleActionAssign; import org.hisp.dhis.rules.models.RuleActionCreateEvent; -import org.hisp.dhis.rules.models.RuleActionMessage; -import org.hisp.dhis.rules.models.RuleActionText; import org.hisp.dhis.rules.models.RuleActionHideField; import org.hisp.dhis.rules.models.RuleActionHideOption; import org.hisp.dhis.rules.models.RuleActionHideOptionGroup; import org.hisp.dhis.rules.models.RuleActionHideProgramStage; import org.hisp.dhis.rules.models.RuleActionHideSection; +import org.hisp.dhis.rules.models.RuleActionMessage; import org.hisp.dhis.rules.models.RuleActionScheduleMessage; import org.hisp.dhis.rules.models.RuleActionSetMandatoryField; +import org.hisp.dhis.rules.models.RuleActionText; import org.hisp.dhis.rules.models.RuleDataValue; import org.hisp.dhis.rules.models.RuleEffect; import org.hisp.dhis.rules.models.RuleEffects; diff --git a/src/test/java/org/hisp/dhis/rules/RuleEngineFunctionTest.java b/src/test/java/org/hisp/dhis/rules/RuleEngineFunctionTest.java index f034c1db..5ac9f5eb 100644 --- a/src/test/java/org/hisp/dhis/rules/RuleEngineFunctionTest.java +++ b/src/test/java/org/hisp/dhis/rules/RuleEngineFunctionTest.java @@ -21,7 +21,6 @@ import java.time.LocalDate; import java.time.ZoneOffset; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.Date; import java.util.HashMap; @@ -147,7 +146,7 @@ public void optionSetNameShouldBeUsed() Option option1 = new Option("name1", "code1"); Option option2 = new Option("name2", "code2"); - List