Introduced deleted flag in REST API (#665)

* — refactored distribution set update test, changed rollout test steps to check if deleted flag is set to false
— added deleted json property for soft deletion of rollout, distribution set, distribution set type, software module, software module type, covered relevant get and put requests with tests

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* Changed deleted flag json property to primitive boolean type, tests refactoring

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* Deleted flag getters renaming

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>
This commit is contained in:
Bondar Bogdan
2018-03-26 18:11:16 +02:00
committed by Dominic Schabel
parent 607cf92a9e
commit d9fc3c0e31
16 changed files with 212 additions and 158 deletions

View File

@@ -50,93 +50,62 @@ public class MgmtDistributionSet extends MgmtNamedEntity {
@JsonProperty
private Boolean complete;
/**
* @return the id
*/
@JsonProperty
private boolean deleted;
public boolean isDeleted() {
return deleted;
}
public void setDeleted(final boolean deleted) {
this.deleted = deleted;
}
public Long getDsId() {
return dsId;
}
/**
* @param id
* the id to set
*/
@JsonIgnore
public void setDsId(final Long id) {
dsId = id;
}
/**
* @return the version
*/
public String getVersion() {
return version;
}
/**
* @param version
* the version to set
*/
public void setVersion(final String version) {
this.version = version;
}
/**
* @return the requiredMigrationStep
*/
public boolean isRequiredMigrationStep() {
return requiredMigrationStep;
}
/**
* @param requiredMigrationStep
* the requiredMigrationStep to set
*/
public void setRequiredMigrationStep(final boolean requiredMigrationStep) {
this.requiredMigrationStep = requiredMigrationStep;
}
/**
* @return the modules
*/
public List<MgmtSoftwareModule> getModules() {
return modules;
}
/**
* @param modules
* the modules to set
*/
public void setModules(final List<MgmtSoftwareModule> modules) {
this.modules = modules;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type
* the type to set
*/
public void setType(final String type) {
this.type = type;
}
/**
* @return the complete
*/
public Boolean getComplete() {
return complete;
}
/**
* @param complete
* the complete to set
*/
public void setComplete(final Boolean complete) {
this.complete = complete;
}

View File

@@ -33,6 +33,17 @@ public class MgmtDistributionSetType extends MgmtNamedEntity {
@JsonProperty
private String key;
@JsonProperty
private boolean deleted;
public boolean isDeleted() {
return deleted;
}
public void setDeleted(final boolean deleted) {
this.deleted = deleted;
}
/**
* @return the moduleId
*/

View File

@@ -40,84 +40,57 @@ public class MgmtRolloutResponseBody extends MgmtNamedEntity {
@JsonProperty
private Map<String, Long> totalTargetsPerStatus;
/**
* @return the status
*/
@JsonProperty
private boolean deleted;
public boolean isDeleted() {
return deleted;
}
public void setDeleted(final boolean deleted) {
this.deleted = deleted;
}
public String getStatus() {
return status;
}
/**
* @param status
* the status to set
*/
public void setStatus(final String status) {
this.status = status;
}
/**
* @return the rolloutId
*/
public Long getRolloutId() {
return rolloutId;
}
/**
* @param rolloutId
* the rolloutId to set
*/
public void setRolloutId(final Long rolloutId) {
this.rolloutId = rolloutId;
}
/**
* @return the targetFilterQuery
*/
public String getTargetFilterQuery() {
return targetFilterQuery;
}
/**
* @param targetFilterQuery
* the targetFilterQuery to set
*/
public void setTargetFilterQuery(final String targetFilterQuery) {
this.targetFilterQuery = targetFilterQuery;
}
/**
* @return the distributionSetId
*/
public Long getDistributionSetId() {
return distributionSetId;
}
/**
* @param distributionSetId
* the distributionSetId to set
*/
public void setDistributionSetId(final Long distributionSetId) {
this.distributionSetId = distributionSetId;
}
/**
* @param totalTargets
* the totalTargets to set
*/
public void setTotalTargets(final Long totalTargets) {
this.totalTargets = totalTargets;
}
/**
* @return the totalTargets
*/
public Long getTotalTargets() {
return totalTargets;
}
/**
* @return the totalTargetsPerStatus
*/
public Map<String, Long> getTotalTargetsPerStatus() {
return totalTargetsPerStatus;
}

View File

@@ -35,63 +35,46 @@ public class MgmtSoftwareModule extends MgmtNamedEntity {
@JsonProperty
private String vendor;
/**
* @return the moduleId
*/
@JsonProperty
private boolean deleted;
public void setDeleted(final boolean deleted) {
this.deleted = deleted;
}
public boolean isDeleted() {
return deleted;
}
public Long getModuleId() {
return moduleId;
}
/**
* @param moduleId
* the moduleId to set
*/
@JsonIgnore
public void setModuleId(final Long moduleId) {
this.moduleId = moduleId;
}
/**
* @return the version
*/
public String getVersion() {
return version;
}
/**
* @param version
* the version to set
*/
public void setVersion(final String version) {
this.version = version;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type
* the type to set
*/
public void setType(final String type) {
this.type = type;
}
/**
* @return the vendor
*/
public String getVendor() {
return vendor;
}
/**
* @param vendor
* the vendor to set
*/
public void setVendor(final String vendor) {
this.vendor = vendor;
}

View File

@@ -33,47 +33,37 @@ public class MgmtSoftwareModuleType extends MgmtNamedEntity {
@JsonProperty
private int maxAssignments;
/**
* @return the moduleId
*/
@JsonProperty
private boolean deleted;
public boolean isDeleted() {
return deleted;
}
public void setDeleted(final boolean deleted) {
this.deleted = deleted;
}
public Long getModuleId() {
return moduleId;
}
/**
* @param moduleId
* the moduleId to set
*/
public void setModuleId(final Long moduleId) {
this.moduleId = moduleId;
}
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @param key
* the key to set
*/
public void setKey(final String key) {
this.key = key;
}
/**
* @return the maxAssignments
*/
public int getMaxAssignments() {
return maxAssignments;
}
/**
* @param maxAssignments
* the maxAssignments to set
*/
public void setMaxAssignments(final int maxAssignments) {
this.maxAssignments = maxAssignments;
}