Skip to content

Commit

Permalink
chore: replace Arrays.asList with List.of
Browse files Browse the repository at this point in the history
  • Loading branch information
jbee committed Nov 28, 2023
1 parent 5edc089 commit 3391cff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.junit.runners.JUnit4;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -80,15 +79,13 @@ public void evaluateD2Round()
RuleVariable ruleVariable7 = RuleVariableNewestEvent.create(
UID0WILD2, "test_data_element7", RuleValueType.NUMERIC, true, new ArrayList<>());

List<RuleAction> actions = Arrays
.asList( ruleAction1, ruleAction2, ruleAction3, ruleAction4, ruleAction5, ruleAction6, ruleAction7,
ruleAction8, ruleAction9, ruleAction10 );
List<RuleAction> actions = List.of(ruleAction1, ruleAction2, ruleAction3, ruleAction4, ruleAction5, ruleAction6, ruleAction7,
ruleAction8, ruleAction9, ruleAction10);
Rule rule = Rule.create( null, null, "true",
actions, "", "" );

List<RuleVariable> ruleVariables = Arrays
.asList( ruleVariable1, ruleVariable2, ruleVariable3, ruleVariable4, ruleVariable5, ruleVariable6,
ruleVariable7 );
List<RuleVariable> ruleVariables = List.of(ruleVariable1, ruleVariable2, ruleVariable3, ruleVariable4, ruleVariable5, ruleVariable6,
ruleVariable7);
RuleEngine.Builder ruleEngineBuilder = getRuleEngineBuilder( rule,
ruleVariables );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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;
Expand Down Expand Up @@ -64,7 +63,7 @@ public void evaluateTenThousandRulesTest()
.status( RuleEnrollment.Status.ACTIVE )
.organisationUnit( "test_ou" )
.organisationUnitCode( "test_ou_code" )
.attributeValues( Arrays.<RuleAttributeValue>asList() )
.attributeValues(List.of())
.build();

RuleEvent ruleEvent = RuleEvent.builder()
Expand Down Expand Up @@ -107,7 +106,7 @@ public void sendMessageMustGetValueFromAssignAction()
.status( RuleEnrollment.Status.ACTIVE )
.organisationUnit( "test_ou" )
.organisationUnitCode( "test_ou_code" )
.attributeValues( Arrays.<RuleAttributeValue>asList() )
.attributeValues(List.of())
.build();

RuleEvent ruleEvent = RuleEvent.builder()
Expand Down Expand Up @@ -172,7 +171,7 @@ public void sendMessageMustGetValueFromAssignActionInSingleExecution()
.status( RuleEnrollment.Status.ACTIVE )
.organisationUnit( "test_ou" )
.organisationUnitCode( "test_ou_code" )
.attributeValues( Arrays.<RuleAttributeValue>asList() )
.attributeValues(List.of())
.build();

RuleEvent ruleEvent = RuleEvent.builder()
Expand Down

0 comments on commit 3391cff

Please sign in to comment.