-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from dhis2/develop
Develop 0.9.7
- Loading branch information
Showing
132 changed files
with
2,595 additions
and
739 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
core-rules/src/main/java/org/hisp/dhis/rules/models/RuleActionScheduleMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.hisp.dhis.rules.models; | ||
|
||
import com.google.auto.value.AutoValue; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
@AutoValue | ||
public abstract class RuleActionScheduleMessage extends RuleAction { | ||
|
||
@Nonnull | ||
public abstract String notification(); | ||
|
||
@Nonnull | ||
public abstract String data(); | ||
|
||
@Nonnull | ||
public static RuleActionScheduleMessage create(@Nullable String notification, @Nullable String data) { | ||
return new AutoValue_RuleActionScheduleMessage(notification == null ? "" : notification, | ||
data == null ? "" : data); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
core-rules/src/main/java/org/hisp/dhis/rules/models/RuleActionSendMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.hisp.dhis.rules.models; | ||
|
||
import com.google.auto.value.AutoValue; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
|
||
@AutoValue | ||
public abstract class RuleActionSendMessage extends RuleAction { | ||
|
||
@Nonnull | ||
public abstract String notification(); | ||
|
||
@Nonnull | ||
public abstract String data(); | ||
|
||
@Nonnull | ||
public static RuleActionSendMessage create(@Nullable String notification, @Nullable String data) { | ||
return new AutoValue_RuleActionSendMessage(notification == null ? "": notification, data == null ? "" : data); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
core-rules/src/test/java/org/hisp/dhis/rules/models/RuleActionScheduleMessageShould.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.hisp.dhis.rules.models; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
import static org.assertj.core.api.Java6Assertions.assertThat; | ||
|
||
@RunWith(JUnit4.class) | ||
public class RuleActionScheduleMessageShould { | ||
|
||
@Test | ||
public void substitute_empty_strings_when_create_with_null_arguments() { | ||
RuleActionScheduleMessage ruleActionScheduleMessage = RuleActionScheduleMessage | ||
.create("notification", "data"); | ||
RuleActionScheduleMessage ruleActionScheduleMessageNoData = RuleActionScheduleMessage | ||
.create("notification", null); | ||
RuleActionScheduleMessage ruleActionScheduleMessageNoNotification = RuleActionScheduleMessage | ||
.create(null, "data"); | ||
|
||
assertThat(ruleActionScheduleMessage.notification()).isEqualTo("notification"); | ||
assertThat(ruleActionScheduleMessage.data()).isEqualTo("data"); | ||
|
||
assertThat(ruleActionScheduleMessageNoData.notification()).isEqualTo("notification"); | ||
assertThat(ruleActionScheduleMessageNoData.data()).isEqualTo(""); | ||
|
||
assertThat(ruleActionScheduleMessageNoNotification.notification()).isEqualTo(""); | ||
assertThat(ruleActionScheduleMessageNoNotification.data()).isEqualTo("data"); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
core-rules/src/test/java/org/hisp/dhis/rules/models/RuleActionSendMessageShould.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.hisp.dhis.rules.models; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.JUnit4; | ||
|
||
import static org.assertj.core.api.Java6Assertions.assertThat; | ||
|
||
@RunWith(JUnit4.class) | ||
public class RuleActionSendMessageShould { | ||
|
||
@Test | ||
public void substitute_empty_strings_when_create_with_null_arguments() { | ||
RuleActionSendMessage ruleActionSendMessage = RuleActionSendMessage.create("notification", "data"); | ||
RuleActionSendMessage ruleActionSendMessageNoData = RuleActionSendMessage.create("notification", null); | ||
RuleActionSendMessage ruleActionSendMessageNoNotification = RuleActionSendMessage.create(null, "data"); | ||
|
||
assertThat(ruleActionSendMessage.notification()).isEqualTo("notification"); | ||
assertThat(ruleActionSendMessage.data()).isEqualTo("data"); | ||
|
||
assertThat(ruleActionSendMessageNoData.notification()).isEqualTo("notification"); | ||
assertThat(ruleActionSendMessageNoData.data()).isEqualTo(""); | ||
|
||
assertThat(ruleActionSendMessageNoNotification.notification()).isEqualTo(""); | ||
assertThat(ruleActionSendMessageNoNotification.data()).isEqualTo("data"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.