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:
committed by
Dominic Schabel
parent
607cf92a9e
commit
d9fc3c0e31
@@ -50,93 +50,62 @@ public class MgmtDistributionSet extends MgmtNamedEntity {
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private Boolean complete;
|
private Boolean complete;
|
||||||
|
|
||||||
/**
|
@JsonProperty
|
||||||
* @return the id
|
private boolean deleted;
|
||||||
*/
|
|
||||||
|
public boolean isDeleted() {
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleted(final boolean deleted) {
|
||||||
|
this.deleted = deleted;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getDsId() {
|
public Long getDsId() {
|
||||||
return dsId;
|
return dsId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id
|
|
||||||
* the id to set
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public void setDsId(final Long id) {
|
public void setDsId(final Long id) {
|
||||||
dsId = id;
|
dsId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version
|
|
||||||
* the version to set
|
|
||||||
*/
|
|
||||||
public void setVersion(final String version) {
|
public void setVersion(final String version) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the requiredMigrationStep
|
|
||||||
*/
|
|
||||||
public boolean isRequiredMigrationStep() {
|
public boolean isRequiredMigrationStep() {
|
||||||
return requiredMigrationStep;
|
return requiredMigrationStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param requiredMigrationStep
|
|
||||||
* the requiredMigrationStep to set
|
|
||||||
*/
|
|
||||||
public void setRequiredMigrationStep(final boolean requiredMigrationStep) {
|
public void setRequiredMigrationStep(final boolean requiredMigrationStep) {
|
||||||
this.requiredMigrationStep = requiredMigrationStep;
|
this.requiredMigrationStep = requiredMigrationStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the modules
|
|
||||||
*/
|
|
||||||
public List<MgmtSoftwareModule> getModules() {
|
public List<MgmtSoftwareModule> getModules() {
|
||||||
return modules;
|
return modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param modules
|
|
||||||
* the modules to set
|
|
||||||
*/
|
|
||||||
public void setModules(final List<MgmtSoftwareModule> modules) {
|
public void setModules(final List<MgmtSoftwareModule> modules) {
|
||||||
this.modules = modules;
|
this.modules = modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param type
|
|
||||||
* the type to set
|
|
||||||
*/
|
|
||||||
public void setType(final String type) {
|
public void setType(final String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the complete
|
|
||||||
*/
|
|
||||||
public Boolean getComplete() {
|
public Boolean getComplete() {
|
||||||
return complete;
|
return complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param complete
|
|
||||||
* the complete to set
|
|
||||||
*/
|
|
||||||
public void setComplete(final Boolean complete) {
|
public void setComplete(final Boolean complete) {
|
||||||
this.complete = complete;
|
this.complete = complete;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,17 @@ public class MgmtDistributionSetType extends MgmtNamedEntity {
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private boolean deleted;
|
||||||
|
|
||||||
|
public boolean isDeleted() {
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleted(final boolean deleted) {
|
||||||
|
this.deleted = deleted;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the moduleId
|
* @return the moduleId
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -40,84 +40,57 @@ public class MgmtRolloutResponseBody extends MgmtNamedEntity {
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private Map<String, Long> totalTargetsPerStatus;
|
private Map<String, Long> totalTargetsPerStatus;
|
||||||
|
|
||||||
/**
|
@JsonProperty
|
||||||
* @return the status
|
private boolean deleted;
|
||||||
*/
|
|
||||||
|
public boolean isDeleted() {
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleted(final boolean deleted) {
|
||||||
|
this.deleted = deleted;
|
||||||
|
}
|
||||||
|
|
||||||
public String getStatus() {
|
public String getStatus() {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param status
|
|
||||||
* the status to set
|
|
||||||
*/
|
|
||||||
public void setStatus(final String status) {
|
public void setStatus(final String status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the rolloutId
|
|
||||||
*/
|
|
||||||
public Long getRolloutId() {
|
public Long getRolloutId() {
|
||||||
return rolloutId;
|
return rolloutId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param rolloutId
|
|
||||||
* the rolloutId to set
|
|
||||||
*/
|
|
||||||
public void setRolloutId(final Long rolloutId) {
|
public void setRolloutId(final Long rolloutId) {
|
||||||
this.rolloutId = rolloutId;
|
this.rolloutId = rolloutId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the targetFilterQuery
|
|
||||||
*/
|
|
||||||
public String getTargetFilterQuery() {
|
public String getTargetFilterQuery() {
|
||||||
return targetFilterQuery;
|
return targetFilterQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param targetFilterQuery
|
|
||||||
* the targetFilterQuery to set
|
|
||||||
*/
|
|
||||||
public void setTargetFilterQuery(final String targetFilterQuery) {
|
public void setTargetFilterQuery(final String targetFilterQuery) {
|
||||||
this.targetFilterQuery = targetFilterQuery;
|
this.targetFilterQuery = targetFilterQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the distributionSetId
|
|
||||||
*/
|
|
||||||
public Long getDistributionSetId() {
|
public Long getDistributionSetId() {
|
||||||
return distributionSetId;
|
return distributionSetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param distributionSetId
|
|
||||||
* the distributionSetId to set
|
|
||||||
*/
|
|
||||||
public void setDistributionSetId(final Long distributionSetId) {
|
public void setDistributionSetId(final Long distributionSetId) {
|
||||||
this.distributionSetId = distributionSetId;
|
this.distributionSetId = distributionSetId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param totalTargets
|
|
||||||
* the totalTargets to set
|
|
||||||
*/
|
|
||||||
public void setTotalTargets(final Long totalTargets) {
|
public void setTotalTargets(final Long totalTargets) {
|
||||||
this.totalTargets = totalTargets;
|
this.totalTargets = totalTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the totalTargets
|
|
||||||
*/
|
|
||||||
public Long getTotalTargets() {
|
public Long getTotalTargets() {
|
||||||
return totalTargets;
|
return totalTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the totalTargetsPerStatus
|
|
||||||
*/
|
|
||||||
public Map<String, Long> getTotalTargetsPerStatus() {
|
public Map<String, Long> getTotalTargetsPerStatus() {
|
||||||
return totalTargetsPerStatus;
|
return totalTargetsPerStatus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,63 +35,46 @@ public class MgmtSoftwareModule extends MgmtNamedEntity {
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String vendor;
|
private String vendor;
|
||||||
|
|
||||||
/**
|
@JsonProperty
|
||||||
* @return the moduleId
|
private boolean deleted;
|
||||||
*/
|
|
||||||
|
public void setDeleted(final boolean deleted) {
|
||||||
|
this.deleted = deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDeleted() {
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getModuleId() {
|
public Long getModuleId() {
|
||||||
return moduleId;
|
return moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param moduleId
|
|
||||||
* the moduleId to set
|
|
||||||
*/
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public void setModuleId(final Long moduleId) {
|
public void setModuleId(final Long moduleId) {
|
||||||
this.moduleId = moduleId;
|
this.moduleId = moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the version
|
|
||||||
*/
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param version
|
|
||||||
* the version to set
|
|
||||||
*/
|
|
||||||
public void setVersion(final String version) {
|
public void setVersion(final String version) {
|
||||||
this.version = version;
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the type
|
|
||||||
*/
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param type
|
|
||||||
* the type to set
|
|
||||||
*/
|
|
||||||
public void setType(final String type) {
|
public void setType(final String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the vendor
|
|
||||||
*/
|
|
||||||
public String getVendor() {
|
public String getVendor() {
|
||||||
return vendor;
|
return vendor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param vendor
|
|
||||||
* the vendor to set
|
|
||||||
*/
|
|
||||||
public void setVendor(final String vendor) {
|
public void setVendor(final String vendor) {
|
||||||
this.vendor = vendor;
|
this.vendor = vendor;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,47 +33,37 @@ public class MgmtSoftwareModuleType extends MgmtNamedEntity {
|
|||||||
@JsonProperty
|
@JsonProperty
|
||||||
private int maxAssignments;
|
private int maxAssignments;
|
||||||
|
|
||||||
/**
|
@JsonProperty
|
||||||
* @return the moduleId
|
private boolean deleted;
|
||||||
*/
|
|
||||||
|
public boolean isDeleted() {
|
||||||
|
return deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeleted(final boolean deleted) {
|
||||||
|
this.deleted = deleted;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getModuleId() {
|
public Long getModuleId() {
|
||||||
return moduleId;
|
return moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param moduleId
|
|
||||||
* the moduleId to set
|
|
||||||
*/
|
|
||||||
public void setModuleId(final Long moduleId) {
|
public void setModuleId(final Long moduleId) {
|
||||||
this.moduleId = moduleId;
|
this.moduleId = moduleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the key
|
|
||||||
*/
|
|
||||||
public String getKey() {
|
public String getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param key
|
|
||||||
* the key to set
|
|
||||||
*/
|
|
||||||
public void setKey(final String key) {
|
public void setKey(final String key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the maxAssignments
|
|
||||||
*/
|
|
||||||
public int getMaxAssignments() {
|
public int getMaxAssignments() {
|
||||||
return maxAssignments;
|
return maxAssignments;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param maxAssignments
|
|
||||||
* the maxAssignments to set
|
|
||||||
*/
|
|
||||||
public void setMaxAssignments(final int maxAssignments) {
|
public void setMaxAssignments(final int maxAssignments) {
|
||||||
this.maxAssignments = maxAssignments;
|
this.maxAssignments = maxAssignments;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ public final class MgmtDistributionSetMapper {
|
|||||||
response.setVersion(distributionSet.getVersion());
|
response.setVersion(distributionSet.getVersion());
|
||||||
response.setComplete(distributionSet.isComplete());
|
response.setComplete(distributionSet.isComplete());
|
||||||
response.setType(distributionSet.getType().getKey());
|
response.setType(distributionSet.getType().getKey());
|
||||||
|
response.setDeleted(distributionSet.isDeleted());
|
||||||
|
|
||||||
distributionSet.getModules()
|
distributionSet.getModules()
|
||||||
.forEach(module -> response.getModules().add(MgmtSoftwareModuleMapper.toResponse(module)));
|
.forEach(module -> response.getModules().add(MgmtSoftwareModuleMapper.toResponse(module)));
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ final class MgmtDistributionSetTypeMapper {
|
|||||||
MgmtRestModelMapper.mapNamedToNamed(result, type);
|
MgmtRestModelMapper.mapNamedToNamed(result, type);
|
||||||
result.setKey(type.getKey());
|
result.setKey(type.getKey());
|
||||||
result.setModuleId(type.getId());
|
result.setModuleId(type.getId());
|
||||||
|
result.setDeleted(type.isDeleted());
|
||||||
|
|
||||||
result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getDistributionSetType(result.getModuleId()))
|
result.add(linkTo(methodOn(MgmtDistributionSetTypeRestApi.class).getDistributionSetType(result.getModuleId()))
|
||||||
.withSelfRel());
|
.withSelfRel());
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ final class MgmtRolloutMapper {
|
|||||||
body.setDistributionSetId(rollout.getDistributionSet().getId());
|
body.setDistributionSetId(rollout.getDistributionSet().getId());
|
||||||
body.setStatus(rollout.getStatus().toString().toLowerCase());
|
body.setStatus(rollout.getStatus().toString().toLowerCase());
|
||||||
body.setTotalTargets(rollout.getTotalTargets());
|
body.setTotalTargets(rollout.getTotalTargets());
|
||||||
|
body.setDeleted(rollout.isDeleted());
|
||||||
|
|
||||||
if (withDetails) {
|
if (withDetails) {
|
||||||
for (final TotalTargetCountStatus.Status status : TotalTargetCountStatus.Status.values()) {
|
for (final TotalTargetCountStatus.Status status : TotalTargetCountStatus.Status.values()) {
|
||||||
|
|||||||
@@ -79,8 +79,7 @@ public final class MgmtSoftwareModuleMapper {
|
|||||||
softwareModules.stream().map(MgmtSoftwareModuleMapper::toResponse).collect(Collectors.toList()));
|
softwareModules.stream().map(MgmtSoftwareModuleMapper::toResponse).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<MgmtSoftwareModuleMetadata> toResponseSwMetadata(
|
static List<MgmtSoftwareModuleMetadata> toResponseSwMetadata(final Collection<SoftwareModuleMetadata> metadata) {
|
||||||
final Collection<SoftwareModuleMetadata> metadata) {
|
|
||||||
if (metadata == null) {
|
if (metadata == null) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
@@ -107,6 +106,7 @@ public final class MgmtSoftwareModuleMapper {
|
|||||||
response.setVersion(softwareModule.getVersion());
|
response.setVersion(softwareModule.getVersion());
|
||||||
response.setType(softwareModule.getType().getKey());
|
response.setType(softwareModule.getType().getKey());
|
||||||
response.setVendor(softwareModule.getVendor());
|
response.setVendor(softwareModule.getVendor());
|
||||||
|
response.setDeleted(softwareModule.isDeleted());
|
||||||
|
|
||||||
response.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getSoftwareModule(response.getModuleId()))
|
response.add(linkTo(methodOn(MgmtSoftwareModuleRestApi.class).getSoftwareModule(response.getModuleId()))
|
||||||
.withSelfRel());
|
.withSelfRel());
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ final class MgmtSoftwareModuleTypeMapper {
|
|||||||
result.setKey(type.getKey());
|
result.setKey(type.getKey());
|
||||||
result.setMaxAssignments(type.getMaxAssignments());
|
result.setMaxAssignments(type.getMaxAssignments());
|
||||||
result.setModuleId(type.getId());
|
result.setModuleId(type.getId());
|
||||||
|
result.setDeleted(type.isDeleted());
|
||||||
|
|
||||||
result.add(linkTo(methodOn(MgmtSoftwareModuleTypeRestApi.class).getSoftwareModuleType(result.getModuleId()))
|
result.add(linkTo(methodOn(MgmtSoftwareModuleTypeRestApi.class).getSoftwareModuleType(result.getModuleId()))
|
||||||
.withSelfRel());
|
.withSelfRel());
|
||||||
|
|||||||
@@ -609,6 +609,7 @@ public class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegr
|
|||||||
.andExpect(jsonPath("$.requiredMigrationStep", equalTo(set.isRequiredMigrationStep())))
|
.andExpect(jsonPath("$.requiredMigrationStep", equalTo(set.isRequiredMigrationStep())))
|
||||||
.andExpect(jsonPath("$.createdBy", equalTo(set.getCreatedBy())))
|
.andExpect(jsonPath("$.createdBy", equalTo(set.getCreatedBy())))
|
||||||
.andExpect(jsonPath("$.complete", equalTo(Boolean.TRUE)))
|
.andExpect(jsonPath("$.complete", equalTo(Boolean.TRUE)))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(set.isDeleted())))
|
||||||
.andExpect(jsonPath("$.createdAt", equalTo(set.getCreatedAt())))
|
.andExpect(jsonPath("$.createdAt", equalTo(set.getCreatedAt())))
|
||||||
.andExpect(jsonPath("$.lastModifiedBy", equalTo(set.getLastModifiedBy())))
|
.andExpect(jsonPath("$.lastModifiedBy", equalTo(set.getLastModifiedBy())))
|
||||||
.andExpect(jsonPath("$.lastModifiedAt", equalTo(set.getLastModifiedAt())))
|
.andExpect(jsonPath("$.lastModifiedAt", equalTo(set.getLastModifiedAt())))
|
||||||
@@ -771,10 +772,15 @@ public class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegr
|
|||||||
|
|
||||||
assertThat(distributionSetManagement.findByCompleted(PAGE, true)).hasSize(1);
|
assertThat(distributionSetManagement.findByCompleted(PAGE, true)).hasSize(1);
|
||||||
|
|
||||||
// perform request
|
mvc.perform(get("/rest/v1/distributionsets/{dsId}", set.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
mvc.perform(delete("/rest/v1/distributionsets/{smId}", set.getId())).andDo(MockMvcResultPrinter.print())
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
|
||||||
|
mvc.perform(delete("/rest/v1/distributionsets/{dsId}", set.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
|
|
||||||
|
mvc.perform(get("/rest/v1/distributionsets/{dsId}", set.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(true)));
|
||||||
|
|
||||||
// check repository content
|
// check repository content
|
||||||
assertThat(distributionSetManagement.findByCompleted(PAGE, true)).hasSize(0);
|
assertThat(distributionSetManagement.findByCompleted(PAGE, true)).hasSize(0);
|
||||||
}
|
}
|
||||||
@@ -790,16 +796,22 @@ public class MgmtDistributionSetResourceTest extends AbstractManagementApiIntegr
|
|||||||
|
|
||||||
assertThat(distributionSetManagement.count()).isEqualTo(1);
|
assertThat(distributionSetManagement.count()).isEqualTo(1);
|
||||||
|
|
||||||
mvc.perform(put("/rest/v1/distributionsets/{dsId}", set.getId())
|
final String body = new JSONObject().put("version", "anotherVersion").put("requiredMigrationStep", true)
|
||||||
.content("{\"version\":\"anotherVersion\",\"requiredMigrationStep\":\"true\"}")
|
.put("deleted", true).toString();
|
||||||
|
|
||||||
|
mvc.perform(put("/rest/v1/distributionsets/{dsId}", set.getId()).content(body)
|
||||||
.contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))
|
.contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))
|
||||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
|
.andExpect(jsonPath("$.version", equalTo("anotherVersion")))
|
||||||
|
.andExpect(jsonPath("$.requiredMigrationStep", equalTo(true)))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
|
||||||
final DistributionSet setupdated = distributionSetManagement.get(set.getId()).get();
|
final DistributionSet setupdated = distributionSetManagement.get(set.getId()).get();
|
||||||
|
|
||||||
assertThat(setupdated.isRequiredMigrationStep()).isEqualTo(true);
|
assertThat(setupdated.isRequiredMigrationStep()).isEqualTo(true);
|
||||||
assertThat(setupdated.getVersion()).isEqualTo("anotherVersion");
|
assertThat(setupdated.getVersion()).isEqualTo("anotherVersion");
|
||||||
assertThat(setupdated.getName()).isEqualTo(set.getName());
|
assertThat(setupdated.getName()).isEqualTo(set.getName());
|
||||||
|
assertThat(setupdated.isDeleted()).isEqualTo(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -363,7 +363,8 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn
|
|||||||
.andExpect(jsonPath("$.description", equalTo("Desc1234")))
|
.andExpect(jsonPath("$.description", equalTo("Desc1234")))
|
||||||
.andExpect(jsonPath("$.createdBy", equalTo("uploadTester")))
|
.andExpect(jsonPath("$.createdBy", equalTo("uploadTester")))
|
||||||
.andExpect(jsonPath("$.createdAt", equalTo(testType.getCreatedAt())))
|
.andExpect(jsonPath("$.createdAt", equalTo(testType.getCreatedAt())))
|
||||||
.andExpect(jsonPath("$.lastModifiedBy", equalTo("uploadTester")));
|
.andExpect(jsonPath("$.lastModifiedBy", equalTo("uploadTester")))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(testType.isDeleted())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -401,9 +402,15 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn
|
|||||||
assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES + 1);
|
assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES + 1);
|
||||||
assertThat(distributionSetManagement.count()).isEqualTo(1);
|
assertThat(distributionSetManagement.count()).isEqualTo(1);
|
||||||
|
|
||||||
mvc.perform(delete("/rest/v1/distributionsettypes/{smId}", testType.getId()))
|
mvc.perform(get("/rest/v1/distributionsettypes/{dstId}", testType.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
|
||||||
|
mvc.perform(delete("/rest/v1/distributionsettypes/{dstId}", testType.getId()))
|
||||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
||||||
|
|
||||||
|
mvc.perform(get("/rest/v1/distributionsettypes/{dstId}", testType.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(true)));
|
||||||
|
|
||||||
assertThat(distributionSetManagement.count()).isEqualTo(1);
|
assertThat(distributionSetManagement.count()).isEqualTo(1);
|
||||||
assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES);
|
assertThat(distributionSetTypeManagement.count()).isEqualTo(DEFAULT_DS_TYPES);
|
||||||
}
|
}
|
||||||
@@ -424,6 +431,20 @@ public class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIn
|
|||||||
.andExpect(jsonPath("$.name", equalTo("TestName123"))).andReturn();
|
.andExpect(jsonPath("$.name", equalTo("TestName123"))).andReturn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Description("Tests the update of the deletion flag. It is verfied that the distribution set type can't be marked as deleted through update operation.")
|
||||||
|
public void updateDistributionSetTypeDeletedFlag() throws Exception {
|
||||||
|
final DistributionSetType testType = distributionSetTypeManagement
|
||||||
|
.create(entityFactory.distributionSetType().create().key("test123").name("TestName123").colour("col"));
|
||||||
|
|
||||||
|
final String body = new JSONObject().put("id", testType.getId()).put("deleted", true).toString();
|
||||||
|
|
||||||
|
mvc.perform(put("/rest/v1/distributionsettypes/{dstId}", testType.getId()).content(body)
|
||||||
|
.contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
|
.andExpect(jsonPath("$.id", equalTo(testType.getId().intValue())))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging.")
|
@Description("Checks the correct behaviour of /rest/v1/distributionsettypes GET requests with paging.")
|
||||||
public void getDistributionSetTypesWithoutAddtionalRequestParameters() throws Exception {
|
public void getDistributionSetTypesWithoutAddtionalRequestParameters() throws Exception {
|
||||||
|
|||||||
@@ -249,7 +249,8 @@ public class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.scheduled", equalTo(15)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.scheduled", equalTo(15)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.cancelled", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.cancelled", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.finished", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.finished", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.error", equalTo(0)));
|
.andExpect(jsonPath("$.totalTargetsPerStatus.error", equalTo(0)))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Step
|
@Step
|
||||||
@@ -266,7 +267,8 @@ public class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.scheduled", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.scheduled", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.cancelled", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.cancelled", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.finished", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.finished", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.error", equalTo(0)));
|
.andExpect(jsonPath("$.totalTargetsPerStatus.error", equalTo(0)))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Step
|
@Step
|
||||||
@@ -285,7 +287,8 @@ public class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.scheduled", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.scheduled", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.cancelled", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.cancelled", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.finished", equalTo(0)))
|
.andExpect(jsonPath("$.totalTargetsPerStatus.finished", equalTo(0)))
|
||||||
.andExpect(jsonPath("$.totalTargetsPerStatus.error", equalTo(0)));
|
.andExpect(jsonPath("$.totalTargetsPerStatus.error", equalTo(0)))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Step
|
@Step
|
||||||
@@ -314,7 +317,8 @@ public class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
.andExpect(
|
.andExpect(
|
||||||
jsonPath("$._links.resume.href", allOf(startsWith(HREF_ROLLOUT_PREFIX), endsWith("/resume"))))
|
jsonPath("$._links.resume.href", allOf(startsWith(HREF_ROLLOUT_PREFIX), endsWith("/resume"))))
|
||||||
.andExpect(jsonPath("$._links.groups.href",
|
.andExpect(jsonPath("$._links.groups.href",
|
||||||
allOf(startsWith(HREF_ROLLOUT_PREFIX), containsString("/deploygroups"))));
|
allOf(startsWith(HREF_ROLLOUT_PREFIX), containsString("/deploygroups"))))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -782,6 +786,16 @@ public class MgmtRolloutResourceTest extends AbstractManagementApiIntegrationTes
|
|||||||
assertThat(getRollout(rollout.getId()).getStatus()).isEqualTo(RolloutStatus.DELETING);
|
assertThat(getRollout(rollout.getId()).getStatus()).isEqualTo(RolloutStatus.DELETING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Description("Soft deletion of a rollout: soft deletion appears when already running rollout is being deleted")
|
||||||
|
public void deleteRunningRollout() throws Exception {
|
||||||
|
final Rollout rollout = testdataFactory.createSoftDeletedRollout("softDeletedRollout");
|
||||||
|
|
||||||
|
mvc.perform(get("/rest/v1/rollouts/{rolloutid}", rollout.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(true)));
|
||||||
|
assertThat(getRollout(rollout.getId()).getStatus()).isEqualTo(RolloutStatus.DELETED);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Testing that rollout paged list with rsql parameter")
|
@Description("Testing that rollout paged list with rsql parameter")
|
||||||
public void getRolloutWithRSQLParam() throws Exception {
|
public void getRolloutWithRSQLParam() throws Exception {
|
||||||
|
|||||||
@@ -114,6 +114,38 @@ public class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegra
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Description("Tests the update of the deletion flag. It is verfied that the software module can't be marked as deleted through update operation.")
|
||||||
|
@WithUser(principal = "smUpdateTester", allSpPermissions = true)
|
||||||
|
public void updateSoftwareModuleDeletedFlag() throws Exception {
|
||||||
|
final String knownSWName = "name1";
|
||||||
|
final String knownSWVersion = "version1";
|
||||||
|
|
||||||
|
SoftwareModule sm = softwareModuleManagement
|
||||||
|
.create(entityFactory.softwareModule().create().type(osType).name(knownSWName).version(knownSWVersion));
|
||||||
|
|
||||||
|
assertThat(sm.isDeleted()).as("Created software module should not be deleted").isEqualTo(false);
|
||||||
|
|
||||||
|
final String body = new JSONObject().put("deleted", true).toString();
|
||||||
|
|
||||||
|
// ensures that we are not to fast so that last modified is not set
|
||||||
|
// correctly
|
||||||
|
Thread.sleep(1);
|
||||||
|
|
||||||
|
mvc.perform(put("/rest/v1/softwaremodules/{smId}", sm.getId()).content(body)
|
||||||
|
.contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
|
.andExpect(jsonPath("$.id", equalTo(sm.getId().intValue())))
|
||||||
|
.andExpect(jsonPath("$.lastModifiedBy", equalTo("smUpdateTester")))
|
||||||
|
.andExpect(jsonPath("$.lastModifiedAt", equalTo(sm.getLastModifiedAt())))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
|
||||||
|
sm = softwareModuleManagement.get(sm.getId()).get();
|
||||||
|
assertThat(sm.getLastModifiedBy()).isEqualTo("smUpdateTester");
|
||||||
|
assertThat(sm.getLastModifiedAt()).isEqualTo(sm.getLastModifiedAt());
|
||||||
|
assertThat(sm.isDeleted()).isEqualTo(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Tests the uppload of an artifact binary. The upload is executed and the content checked in the repository for completenes.")
|
@Description("Tests the uppload of an artifact binary. The upload is executed and the content checked in the repository for completenes.")
|
||||||
public void uploadArtifact() throws Exception {
|
public void uploadArtifact() throws Exception {
|
||||||
@@ -614,6 +646,7 @@ public class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegra
|
|||||||
.andExpect(jsonPath("$.description", equalTo(os.getDescription())))
|
.andExpect(jsonPath("$.description", equalTo(os.getDescription())))
|
||||||
.andExpect(jsonPath("$.vendor", equalTo(os.getVendor())))
|
.andExpect(jsonPath("$.vendor", equalTo(os.getVendor())))
|
||||||
.andExpect(jsonPath("$.type", equalTo(os.getType().getKey())))
|
.andExpect(jsonPath("$.type", equalTo(os.getType().getKey())))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(os.isDeleted())))
|
||||||
.andExpect(jsonPath("$.createdBy", equalTo("uploadTester")))
|
.andExpect(jsonPath("$.createdBy", equalTo("uploadTester")))
|
||||||
.andExpect(jsonPath("$.createdAt", equalTo(os.getCreatedAt())))
|
.andExpect(jsonPath("$.createdAt", equalTo(os.getCreatedAt())))
|
||||||
.andExpect(jsonPath("$._links.metadata.href",
|
.andExpect(jsonPath("$._links.metadata.href",
|
||||||
@@ -706,28 +739,29 @@ public class MgmtSoftwareModuleResourceTest extends AbstractManagementApiIntegra
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Verifies successfull deletion of software modules that are in use, i.e. assigned to a DS which should result in movinf the module to the archive.")
|
@Description("Verifies successfull deletion of a software module that is in use, i.e. assigned to a DS which should result in movinf the module to the archive.")
|
||||||
public void deleteAssignedSoftwareModule() throws Exception {
|
public void deleteAssignedSoftwareModule() throws Exception {
|
||||||
final DistributionSet ds1 = testdataFactory.createDistributionSet("a");
|
final DistributionSet ds1 = testdataFactory.createDistributionSet("a");
|
||||||
|
|
||||||
final byte random[] = RandomStringUtils.random(5 * 1024).getBytes();
|
final byte random[] = RandomStringUtils.random(5 * 1024).getBytes();
|
||||||
|
|
||||||
artifactManagement.create(new ByteArrayInputStream(random), ds1.findFirstModuleByType(appType).get().getId(),
|
final Long appTypeSmId = ds1.findFirstModuleByType(appType).get().getId();
|
||||||
"file1", false);
|
|
||||||
|
|
||||||
assertThat(softwareModuleManagement.findAll(PAGE)).hasSize(3);
|
artifactManagement.create(new ByteArrayInputStream(random), appTypeSmId, "file1", false);
|
||||||
|
|
||||||
|
assertThat(softwareModuleManagement.count()).isEqualTo(3);
|
||||||
assertThat(artifactManagement.count()).isEqualTo(1);
|
assertThat(artifactManagement.count()).isEqualTo(1);
|
||||||
|
|
||||||
mvc.perform(delete("/rest/v1/softwaremodules/{smId}", ds1.findFirstModuleByType(appType).get().getId()))
|
mvc.perform(get("/rest/v1/softwaremodules/{smId}", appTypeSmId)).andDo(MockMvcResultPrinter.print())
|
||||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
mvc.perform(delete("/rest/v1/softwaremodules/{smId}", ds1.findFirstModuleByType(runtimeType).get().getId()))
|
|
||||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
|
||||||
mvc.perform(delete("/rest/v1/softwaremodules/{smId}", ds1.findFirstModuleByType(osType).get().getId()))
|
|
||||||
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
|
||||||
|
|
||||||
// all 3 are now marked as deleted
|
mvc.perform(delete("/rest/v1/softwaremodules/{smId}", appTypeSmId)).andDo(MockMvcResultPrinter.print())
|
||||||
assertThat(softwareModuleManagement.findAll(PAGE).getNumber())
|
.andExpect(status().isOk());
|
||||||
.as("After delete no softwarmodule should be available").isEqualTo(0);
|
|
||||||
|
mvc.perform(get("/rest/v1/softwaremodules/{smId}", appTypeSmId)).andDo(MockMvcResultPrinter.print())
|
||||||
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(true)));
|
||||||
|
|
||||||
|
assertThat(softwareModuleManagement.count()).isEqualTo(2);
|
||||||
assertThat(artifactManagement.count()).isEqualTo(1);
|
assertThat(artifactManagement.count()).isEqualTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,8 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt
|
|||||||
.andExpect(jsonPath("$.createdBy", equalTo("uploadTester")))
|
.andExpect(jsonPath("$.createdBy", equalTo("uploadTester")))
|
||||||
.andExpect(jsonPath("$.createdAt", equalTo(testType.getCreatedAt())))
|
.andExpect(jsonPath("$.createdAt", equalTo(testType.getCreatedAt())))
|
||||||
.andExpect(jsonPath("$.lastModifiedBy", equalTo("uploadTester")))
|
.andExpect(jsonPath("$.lastModifiedBy", equalTo("uploadTester")))
|
||||||
.andExpect(jsonPath("$.lastModifiedAt", equalTo(testType.getLastModifiedAt())));
|
.andExpect(jsonPath("$.lastModifiedAt", equalTo(testType.getLastModifiedAt())))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(testType.isDeleted())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -255,8 +256,14 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt
|
|||||||
|
|
||||||
assertThat(softwareModuleTypeManagement.count()).isEqualTo(4);
|
assertThat(softwareModuleTypeManagement.count()).isEqualTo(4);
|
||||||
|
|
||||||
mvc.perform(delete("/rest/v1/softwaremoduletypes/{smId}", testType.getId())).andDo(MockMvcResultPrinter.print())
|
mvc.perform(get("/rest/v1/softwaremoduletypes/{smtId}", testType.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
|
||||||
|
mvc.perform(delete("/rest/v1/softwaremoduletypes/{smtId}", testType.getId()))
|
||||||
|
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());
|
||||||
|
|
||||||
|
mvc.perform(get("/rest/v1/softwaremoduletypes/{smtId}", testType.getId())).andDo(MockMvcResultPrinter.print())
|
||||||
|
.andExpect(status().isOk()).andExpect(jsonPath("$.deleted", equalTo(true)));
|
||||||
|
|
||||||
assertThat(softwareModuleTypeManagement.count()).isEqualTo(3);
|
assertThat(softwareModuleTypeManagement.count()).isEqualTo(3);
|
||||||
}
|
}
|
||||||
@@ -277,6 +284,24 @@ public class MgmtSoftwareModuleTypeResourceTest extends AbstractManagementApiInt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Description("Tests the update of the deletion flag. It is verfied that the software module type can't be marked as deleted through update operation.")
|
||||||
|
public void updateSoftwareModuleTypeDeletedFlag() throws Exception {
|
||||||
|
SoftwareModuleType testType = createTestType();
|
||||||
|
|
||||||
|
final String body = new JSONObject().put("id", testType.getId()).put("deleted", true).toString();
|
||||||
|
|
||||||
|
mvc.perform(put("/rest/v1/softwaremoduletypes/{smtId}", testType.getId()).content(body)
|
||||||
|
.contentType(MediaType.APPLICATION_JSON)).andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
|
||||||
|
.andExpect(jsonPath("$.id", equalTo(testType.getId().intValue())))
|
||||||
|
.andExpect(jsonPath("$.lastModifiedAt", equalTo(testType.getLastModifiedAt())))
|
||||||
|
.andExpect(jsonPath("$.deleted", equalTo(false)));
|
||||||
|
|
||||||
|
testType = softwareModuleTypeManagement.get(testType.getId()).get();
|
||||||
|
assertThat(testType.getLastModifiedAt()).isEqualTo(testType.getLastModifiedAt());
|
||||||
|
assertThat(testType.isDeleted()).isEqualTo(false);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging.")
|
@Description("Checks the correct behaviour of /rest/v1/softwaremoduletypes GET requests with paging.")
|
||||||
public void getSoftwareModuleTypesWithoutAddtionalRequestParameters() throws Exception {
|
public void getSoftwareModuleTypesWithoutAddtionalRequestParameters() throws Exception {
|
||||||
|
|||||||
@@ -1028,4 +1028,22 @@ public class TestdataFactory {
|
|||||||
return createRolloutByVariables(prefix, prefix + " description", 10, "controllerId==" + prefix + "*",
|
return createRolloutByVariables(prefix, prefix + " description", 10, "controllerId==" + prefix + "*",
|
||||||
createDistributionSet(prefix), "50", "5");
|
createDistributionSet(prefix), "50", "5");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the soft deleted {@link Rollout} with a new
|
||||||
|
* {@link DistributionSet} and {@link Target}s.
|
||||||
|
*
|
||||||
|
* @param prefix
|
||||||
|
* for rollouts name, description,
|
||||||
|
* {@link Target#getControllerId()} filter
|
||||||
|
* @return created {@link Rollout}
|
||||||
|
*/
|
||||||
|
public Rollout createSoftDeletedRollout(final String prefix) {
|
||||||
|
final Rollout newRollout = createRollout(prefix);
|
||||||
|
rolloutManagement.start(newRollout.getId());
|
||||||
|
rolloutManagement.handleRollouts();
|
||||||
|
rolloutManagement.delete(newRollout.getId());
|
||||||
|
rolloutManagement.handleRollouts();
|
||||||
|
return newRollout;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user