diff --git a/pom.xml b/pom.xml index a33a0b5..447eb88 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-plan-evaluator jar - 1.6.6-SNAPSHOT + 1.6.7-SNAPSHOT OpenSRP Plan Evaluator OpenSRP Plan Evaluator Library https://github.com/OpenSRP/opensrp-plan-evaluator diff --git a/src/main/java/org/smartregister/domain/Practitioner.java b/src/main/java/org/smartregister/domain/Practitioner.java index 847cffd..6c0f2ce 100644 --- a/src/main/java/org/smartregister/domain/Practitioner.java +++ b/src/main/java/org/smartregister/domain/Practitioner.java @@ -1,6 +1,8 @@ package org.smartregister.domain; +import org.joda.time.DateTime; + import java.io.Serializable; /** @@ -20,6 +22,12 @@ public class Practitioner implements Serializable { private String username; + private DateTime dateCreated; + + private DateTime dateEdited; + + private long serverVersion; + public String getIdentifier() { return identifier; } @@ -60,4 +68,27 @@ public void setUsername(String username) { this.username = username; } -} \ No newline at end of file + public DateTime getDateCreated() { + return dateCreated; + } + + public void setDateCreated(DateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public DateTime getDateEdited() { + return dateEdited; + } + + public void setDateEdited(DateTime dateEdited) { + this.dateEdited = dateEdited; + } + + public long getServerVersion() { + return serverVersion; + } + + public void setServerVersion(long serverVersion) { + this.serverVersion = serverVersion; + } +} diff --git a/src/test/java/org/smartregister/domain/PractitionerTest.java b/src/test/java/org/smartregister/domain/PractitionerTest.java index 573238e..60a04ed 100644 --- a/src/test/java/org/smartregister/domain/PractitionerTest.java +++ b/src/test/java/org/smartregister/domain/PractitionerTest.java @@ -1,6 +1,7 @@ package org.smartregister.domain; import junit.framework.TestCase; +import org.joda.time.DateTime; import org.junit.Assert; public class PractitionerTest extends TestCase { @@ -83,4 +84,46 @@ public void testSetUsername() { Assert.assertEquals(username, practitioner.getUsername()); } + + public void testSetDateCreated() { + DateTime dateCreated = new DateTime(); + practitioner.setDateCreated(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateCreated()); + } + + public void testGetDateCreated() { + DateTime dateCreated = new DateTime(); + practitioner.setDateCreated(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateCreated()); + } + + public void testSetDateEdited() { + DateTime dateCreated = new DateTime(); + practitioner.setDateEdited(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateEdited()); + } + + public void testGetDateEdited() { + DateTime dateCreated = new DateTime(); + practitioner.setDateEdited(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateEdited()); + } + + public void testSetServerVersion() { + long serverVersion = 1; + practitioner.setServerVersion(serverVersion); + + Assert.assertEquals(serverVersion, practitioner.getServerVersion()); + } + + public void testGetServerVersion() { + long serverVersion = 2; + practitioner.setServerVersion(serverVersion); + + Assert.assertEquals(serverVersion, practitioner.getServerVersion()); + } }