From 8fa311e11908f8aadec195cd197c7df3836c8132 Mon Sep 17 00:00:00 2001 From: harshanl Date: Wed, 10 Aug 2016 18:25:35 +0530 Subject: [PATCH] Removed unnecessary properties from EnrollmentInfo object --- .../carbon/device/mgt/common/EnrolmentInfo.java | 17 +++-------------- .../mgt/core/dao/EnrolmentPersistenceTests.java | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java index 2ba839243c..70e666431c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java @@ -40,11 +40,9 @@ public class EnrolmentInfo implements Serializable { @ApiModelProperty(name = "id", value = "ID of the device in the WSO2 EMM device information database.", required = true) private int id; - @ApiModelProperty(name = "device", value = "Enrolled device.", required = true) - private Device device; - @ApiModelProperty(name = "dateOfEnrolment", value = "Date of the device enrollment.", required = true ) + @ApiModelProperty(name = "dateOfEnrolment", value = "Date of the device enrollment. This value is not necessary.", required = false ) private Long dateOfEnrolment; - @ApiModelProperty(name = "dateOfLastUpdate", value = "Date of the device's last update.", required = true ) + @ApiModelProperty(name = "dateOfLastUpdate", value = "Date of the device's last update. This value is not necessary.", required = false ) private Long dateOfLastUpdate; @ApiModelProperty(name = "ownership", value = "Defines the ownership details. The ownership type can be any of the" + " following values.\n" + @@ -60,8 +58,7 @@ public class EnrolmentInfo implements Serializable { public EnrolmentInfo() { } - public EnrolmentInfo(Device device, String owner, OwnerShip ownership, Status status) { - this.device = device; + public EnrolmentInfo(String owner, OwnerShip ownership, Status status) { this.owner = owner; this.ownership = ownership; this.status = status; @@ -115,14 +112,6 @@ public class EnrolmentInfo implements Serializable { this.owner = owner; } - public Device getDevice() { - return device; - } - - public void setDevice(Device device) { - this.device = device; - } - @Override public boolean equals(Object obj) { if (obj instanceof EnrolmentInfo) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/dao/EnrolmentPersistenceTests.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/dao/EnrolmentPersistenceTests.java index 6d7e4b4bb6..7ba74caa10 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/dao/EnrolmentPersistenceTests.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/dao/EnrolmentPersistenceTests.java @@ -41,7 +41,7 @@ public class EnrolmentPersistenceTests extends BaseDeviceManagementTest { /* Initializing source enrolment configuration bean to be tested */ EnrolmentInfo source = - new EnrolmentInfo(null, owner, EnrolmentInfo.OwnerShip.BYOD, + new EnrolmentInfo(owner, EnrolmentInfo.OwnerShip.BYOD, EnrolmentInfo.Status.CREATED); /* Adding dummy enrolment configuration to the device management metadata store */