Fix already assigned targets (#919)
* Dont count not existing targets as already assigned to DS Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Add test for deploymentManagement Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Delete 404 error message from docs when target is not found Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Add text to implementation notes Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Add assertions to test Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Add expected behaviour to test description Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Refactor deploymentMgmtTest Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Filter out non-existing controllerIds Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Extend test descriptions Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Refactor createTargets method Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Add createTargetAndJsonArray method Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Correct expected test result Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Adapt rest docs Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Correct test Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Only count targets that exist for total and adapt test Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Use only existign targetWithActionTypes for assignment Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com> * Rename targetIds to providedTargetIds Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>
This commit is contained in:
committed by
Dominic Schabel
parent
5feb5873c4
commit
8d3ba68be9
@@ -858,6 +858,24 @@ public class TestdataFactory {
|
||||
return targetManagement.create(targets);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link Target}s in repository and with given targetIds.
|
||||
*
|
||||
* @param targetIds
|
||||
* specifies the IDs of the targets
|
||||
*
|
||||
* @return {@link List} of {@link Target} entities
|
||||
*/
|
||||
public List<Target> createTargets(final String... targetIds) {
|
||||
|
||||
final List<TargetCreate> targets = new ArrayList<>();
|
||||
for (final String targetId : targetIds) {
|
||||
targets.add(entityFactory.target().create().controllerId(targetId));
|
||||
}
|
||||
|
||||
return targetManagement.create(targets);
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds {@link Target} objects with given prefix for
|
||||
* {@link Target#getControllerId()} followed by a number suffix.
|
||||
|
||||
Reference in New Issue
Block a user