Fix retrieve Rollout with details (#2435)

* Fix retrieve Rollout with details

* Rename RolloutManagement method for retrieve Rollout slice with details. Slight refactoring in MgmtRolloutMapper

---------

Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
This commit is contained in:
Vasil Ilchev
2025-06-09 15:38:20 +03:00
committed by GitHub
parent 5a304af165
commit 09a3d3e0c6
5 changed files with 20 additions and 18 deletions

View File

@@ -22,11 +22,9 @@ import org.eclipse.hawkbit.repository.builder.DistributionSetCreate;
import org.eclipse.hawkbit.repository.builder.DistributionSetTypeCreate;
import org.eclipse.hawkbit.repository.builder.DynamicRolloutGroupTemplate;
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
import org.eclipse.hawkbit.repository.jpa.model.JpaRollout;
import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Rollout;
import org.eclipse.hawkbit.repository.model.RolloutGroupConditionBuilder;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.repository.test.util.WithUser;
import org.junit.jupiter.api.Test;
import org.springframework.data.domain.PageImpl;
@@ -159,7 +157,7 @@ class RolloutManagementSecurityTest extends AbstractJpaIntegrationTest {
@Test
@Description("Tests ManagementAPI PreAuthorized method with correct and insufficient permissions.")
void setRolloutStatusDetailsPermissionsCheck() {
void getRolloutWithStatusDetailsPermissionsCheck() {
final String rolloutName = "rollout-std";
final int amountGroups = 5; // static only
final String targetPrefix = "controller-rollout-std-";
@@ -169,9 +167,9 @@ class RolloutManagementSecurityTest extends AbstractJpaIntegrationTest {
final Rollout rollout = testdataFactory.createRolloutByVariables(rolloutName, rolloutName, amountGroups,
"controllerid==" + targetPrefix + "*", distributionSet, "60", "30", false, false);
assertPermissions(() -> {
rolloutManagement.setRolloutStatusDetails(new PageImpl<>(List.of(rollout)));
rolloutManagement.getRolloutWithStatusDetails(new PageImpl<>(List.of(rollout)));
return null;
}, List.of(SpPermission.UPDATE_ROLLOUT, SpPermission.READ_REPOSITORY));
}, List.of(SpPermission.READ_ROLLOUT, SpPermission.READ_REPOSITORY));
}
@Test