Fix DS Type update to do not remove mandatory/optional module types (#2598)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-08-07 14:29:54 +03:00
committed by GitHub
parent e2beb898f8
commit 08ff739bbe
4 changed files with 9 additions and 13 deletions

View File

@@ -811,11 +811,13 @@ class MgmtDistributionSetTypeResourceTest extends AbstractManagementApiIntegrati
.build(),
DistributionSetTypeManagement.Create.builder()
.key("testKey2").name("TestName2").description("Desc2").colour("col")
.mandatoryModuleTypes(Set.of())
.optionalModuleTypes(Set.of(runtimeType, osType, appType))
.build(),
DistributionSetTypeManagement.Create.builder()
.key("testKey3").name("TestName3").description("Desc3").colour("col")
.mandatoryModuleTypes(Set.of(runtimeType, osType))
.optionalModuleTypes(Set.of())
.build());
}

View File

@@ -3015,15 +3015,12 @@ class MgmtTargetResourceTest extends AbstractManagementApiIntegrationTest {
assertThat(targetManagement.isControllerAttributesRequested(knownTargetId)).isTrue();
}
private String getCreateTargetsListJsonString(final String controllerId, final String name,
final String description) {
return "[{\"name\":\"" + name + "\",\"controllerId\":\"" + controllerId + "\",\"description\":\"" + description
+ "\"}]";
private String getCreateTargetsListJsonString(final String controllerId, final String name, final String description) {
return "[{\"name\":\"" + name + "\",\"controllerId\":\"" + controllerId + "\",\"description\":\"" + description + "\"}]";
}
private Target createSingleTarget(final String controllerId, final String name) {
targetManagement.create(entityFactory.target().create().controllerId(controllerId).name(name)
.description(TARGET_DESCRIPTION_TEST));
targetManagement.create(entityFactory.target().create().controllerId(controllerId).name(name).description(TARGET_DESCRIPTION_TEST));
return controllerManagement.findOrRegisterTargetIfItDoesNotExist(controllerId, LOCALHOST);
}