Skip to content

Commit

Permalink
refactor RuleActionHideProgramStage to kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
enricocolasante committed Dec 6, 2023
1 parent a85b765 commit dd7334f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 29 deletions.
14 changes: 0 additions & 14 deletions src/main/java/org/hisp/dhis/rules/models/RuleAction.java

This file was deleted.

7 changes: 7 additions & 0 deletions src/main/java/org/hisp/dhis/rules/models/RuleAction.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.hisp.dhis.rules.models

import javax.annotation.Nonnull

fun interface RuleAction {
fun data(): String
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.hisp.dhis.rules.models

data class RuleActionHideProgramStage(
val programStage: String,
val data: String = ""
) : RuleAction {
override fun data(): String {
return data
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class RuleEngineEffectTypesTest {

@Test
fun simpleConditionMustResultInHideProgramStageEffect() {
val ruleAction: RuleAction = RuleActionHideProgramStage.create("test_program_stage")
val ruleAction: RuleAction = RuleActionHideProgramStage("test_program_stage")
val rule = Rule.create(null, null, "true", List.of(ruleAction), "", "")
val ruleEngine = getRuleEngine(rule)
val ruleEffects = ruleEngine.evaluate(getTestRuleEvent(RuleEvent.Status.ACTIVE)).call()
Expand Down

0 comments on commit dd7334f

Please sign in to comment.