Merge branch 'master' into Download_server_supports_download_through_HTTP_and_HTTPs

This commit is contained in:
Michael Hirsch
2016-04-05 15:45:47 +02:00
61 changed files with 421 additions and 1329 deletions

View File

@@ -139,9 +139,9 @@ public class DistributionSetTagResource implements DistributionSetTagRestApi {
final DistributionSetTagAssigmentResultRest tagAssigmentResultRest = new DistributionSetTagAssigmentResultRest();
tagAssigmentResultRest.setAssignedDistributionSets(
DistributionSetMapper.toResponseDistributionSets(assigmentResult.getAssignedDs()));
DistributionSetMapper.toResponseDistributionSets(assigmentResult.getAssignedEntity()));
tagAssigmentResultRest.setUnassignedDistributionSets(
DistributionSetMapper.toResponseDistributionSets(assigmentResult.getUnassignedDs()));
DistributionSetMapper.toResponseDistributionSets(assigmentResult.getUnassignedEntity()));
LOG.debug("Toggled assignedDS {} and unassignedDS{}", assigmentResult.getAssigned(),
assigmentResult.getUnassigned());

View File

@@ -263,7 +263,7 @@ public class TargetResource implements TargetRestApi {
final ActionType type = (dsId.getType() != null)
? RestResourceConversionHelper.convertActionType(dsId.getType()) : ActionType.FORCED;
final Iterator<Target> changed = this.deploymentManagement
.assignDistributionSet(dsId.getId(), type, dsId.getForcetime(), targetId).getAssignedTargets()
.assignDistributionSet(dsId.getId(), type, dsId.getForcetime(), targetId).getAssignedEntity()
.iterator();
if (changed.hasNext()) {
return new ResponseEntity<>(HttpStatus.OK);

View File

@@ -133,8 +133,8 @@ public class TargetTagResource implements TargetTagRestApi {
.toggleTagAssignment(findTargetControllerIds(assignedTargetRequestBodies), targetTag.getName());
final TargetTagAssigmentResultRest tagAssigmentResultRest = new TargetTagAssigmentResultRest();
tagAssigmentResultRest.setAssignedTargets(TargetMapper.toResponse(assigmentResult.getAssignedTargets()));
tagAssigmentResultRest.setUnassignedTargets(TargetMapper.toResponse(assigmentResult.getUnassignedTargets()));
tagAssigmentResultRest.setAssignedTargets(TargetMapper.toResponse(assigmentResult.getAssignedEntity()));
tagAssigmentResultRest.setUnassignedTargets(TargetMapper.toResponse(assigmentResult.getUnassignedEntity()));
return new ResponseEntity<>(tagAssigmentResultRest, HttpStatus.OK);
}

View File

@@ -114,12 +114,12 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
assertThat(actionStatusRepository.findAll()).isEmpty();
List<Target> saved = deploymentManagement.assignDistributionSet(ds.getId(), ActionType.FORCED,
Action.NO_FORCE_TIME, savedTarget.getControllerId()).getAssignedTargets();
Action.NO_FORCE_TIME, savedTarget.getControllerId()).getAssignedEntity();
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
assertThat(actionRepository.findAll()).hasSize(1);
saved = deploymentManagement.assignDistributionSet(ds2, saved).getAssignedTargets();
saved = deploymentManagement.assignDistributionSet(ds2, saved).getAssignedEntity();
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(2);
assertThat(actionRepository.findAll()).hasSize(2);
@@ -258,12 +258,12 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
List<Target> saved = deploymentManagement
.assignDistributionSet(ds.getId(), ActionType.SOFT, Action.NO_FORCE_TIME, savedTarget.getControllerId())
.getAssignedTargets();
.getAssignedEntity();
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
assertThat(actionRepository.findAll()).hasSize(1);
saved = deploymentManagement.assignDistributionSet(ds2, saved).getAssignedTargets();
saved = deploymentManagement.assignDistributionSet(ds2, saved).getAssignedEntity();
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(2);
assertThat(actionRepository.findAll()).hasSize(2);
@@ -390,12 +390,12 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
assertThat(actionStatusRepository.findAll()).isEmpty();
List<Target> saved = deploymentManagement.assignDistributionSet(ds.getId(), ActionType.TIMEFORCED,
System.currentTimeMillis(), savedTarget.getControllerId()).getAssignedTargets();
System.currentTimeMillis(), savedTarget.getControllerId()).getAssignedEntity();
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(1);
final Action action = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
assertThat(actionRepository.findAll()).hasSize(1);
saved = deploymentManagement.assignDistributionSet(ds2, saved).getAssignedTargets();
saved = deploymentManagement.assignDistributionSet(ds2, saved).getAssignedEntity();
assertThat(deploymentManagement.findActiveActionsByTarget(savedTarget)).hasSize(2);
assertThat(actionRepository.findAll()).hasSize(2);
@@ -941,7 +941,7 @@ public class DeploymentBaseTest extends AbstractIntegrationTestWithMongoDB {
assertThat(targetManagement.findTargetByControllerID("4712").getTargetInfo().getUpdateStatus())
.isEqualTo(TargetUpdateStatus.UNKNOWN);
savedTarget = deploymentManagement.assignDistributionSet(savedSet, toAssign).getAssignedTargets().iterator()
savedTarget = deploymentManagement.assignDistributionSet(savedSet, toAssign).getAssignedEntity().iterator()
.next();
deploymentManagement.assignDistributionSet(savedSet2, toAssign2);

View File

@@ -270,7 +270,7 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
Target savedTarget = targetManagement.createTarget(target);
final List<Target> toAssign = new ArrayList<Target>();
toAssign.add(savedTarget);
savedTarget = deploymentManagement.assignDistributionSet(ds, toAssign).getAssignedTargets().iterator().next();
savedTarget = deploymentManagement.assignDistributionSet(ds, toAssign).getAssignedEntity().iterator().next();
final Action savedAction = deploymentManagement.findActiveActionsByTarget(savedTarget).get(0);
mvc.perform(post("/{tenant}/controller/v1/911/deploymentBase/" + savedAction.getId() + "/feedback",
tenantAware.getCurrentTenant())

View File

@@ -1029,7 +1029,7 @@ public class TargetResourceTest extends AbstractIntegrationTest {
// Update
final List<Target> updatedTargets = deploymentManagement.assignDistributionSet(one, targets)
.getAssignedTargets();
.getAssignedEntity();
// 2nd update
// sleep 10ms to ensure that we can sort by reportedAt
Thread.sleep(10);