introduced open actionIds in MgmtTargetAssignmentResponseBody (#864)

* introduced open actionIds in MgmtTargetAssignmentResponseBody

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed SonarQube issues

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* removed unused method parameter

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* updated documentation tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* added limit to the alreadyAssignedActions in the AssignmentResult

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* moved alreadyAssignedActions limitation to MgmtDistributionSetMapper

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* removed alreadyAssignedActions

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed sonarQube issues

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed compilation error

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed PR review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed PR review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* Renamed AssignmentResult to AbstractAssignmentResult

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed formatting

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* reverted method visibility

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>
This commit is contained in:
Ahmed Sayed
2019-08-20 11:31:20 +02:00
committed by Dominic Schabel
parent 973f1952c7
commit d40b11d2ab
43 changed files with 580 additions and 402 deletions

View File

@@ -1210,14 +1210,16 @@ public class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest
// Update
if (schedule == null) {
final List<Target> updatedTargets = assignDistributionSet(one, Arrays.asList(target)).getAssignedEntity();
final List<Target> updatedTargets = assignDistributionSet(one, Arrays.asList(target)).getAssignedEntity()
.stream().map(Action::getTarget).collect(Collectors.toList());
// 2nd update
// sleep 10ms to ensure that we can sort by reportedAt
Thread.sleep(10);
assignDistributionSet(two, updatedTargets);
} else {
final List<Target> updatedTargets = assignDistributionSetWithMaintenanceWindow(one.getId(),
target.getControllerId(), schedule, duration, timezone).getAssignedEntity();
target.getControllerId(), schedule, duration, timezone).getAssignedEntity().stream()
.map(Action::getTarget).collect(Collectors.toList());
// 2nd update
// sleep 10ms to ensure that we can sort by reportedAt
Thread.sleep(10);
@@ -1238,9 +1240,8 @@ public class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest
public void updateAction() throws Exception {
final Target target = testdataFactory.createTarget();
final DistributionSet set = testdataFactory.createDistributionSet();
final Long actionId = deploymentManagement
.assignDistributionSet(set.getId(), ActionType.SOFT, 0, Arrays.asList(target.getControllerId()))
.getActionIds().get(0);
final Long actionId = getFirstAssignedActionId(deploymentManagement.assignDistributionSet(set.getId(),
ActionType.SOFT, 0, Collections.singletonList(target.getControllerId())));
assertThat(deploymentManagement.findAction(actionId).get().getActionType()).isEqualTo(ActionType.SOFT);
final String body = new JSONObject().put("forceType", "forced").toString();