Remove unused TargetWithActionStatus and its retrieval methods (#2142)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -88,6 +88,6 @@ public class RolloutGroupEventTest extends AbstractRemoteEntityEventTest<Rollout
|
||||
false, new RolloutGroupConditionBuilder().withDefaults()
|
||||
.successCondition(RolloutGroupSuccessCondition.THRESHOLD, "10").build());
|
||||
|
||||
return rolloutGroupManagement.findByRollout(PAGE, entity.getId()).getContent().get(0);
|
||||
return rolloutGroupManagement.findByRollout(entity.getId(), PAGE).getContent().get(0);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class ConcurrentDistributionSetInvalidationTest extends AbstractJpaIntegr
|
||||
Awaitility.await().atMost(Duration.ofSeconds(5))
|
||||
.pollInterval(Duration.ofMillis(100))
|
||||
.until(() -> tenantAware.runAsTenant(tenant, () -> systemSecurityContext
|
||||
.runAsSystem(() -> rolloutGroupManagement.findByRollout(PAGE, rollout.getId()).getSize() > 0)));
|
||||
.runAsSystem(() -> rolloutGroupManagement.findByRollout(rollout.getId(), PAGE).getSize() > 0)));
|
||||
|
||||
assertThatExceptionOfType(StopRolloutException.class)
|
||||
.as("Invalidation of distributionSet should throw an exception")
|
||||
|
||||
@@ -317,12 +317,12 @@ class TargetAccessControllerTest extends AbstractAccessControllerTest {
|
||||
|
||||
assertThat(rollout.getTotalTargets()).isEqualTo(updateTargets.size());
|
||||
|
||||
final List<RolloutGroup> content = rolloutGroupManagement.findByRollout(Pageable.unpaged(), rollout.getId())
|
||||
final List<RolloutGroup> content = rolloutGroupManagement.findByRollout(rollout.getId(), Pageable.unpaged())
|
||||
.getContent();
|
||||
assertThat(content).hasSize(updateTargets.size());
|
||||
|
||||
final List<Target> rolloutTargets = content.stream().flatMap(
|
||||
group -> rolloutGroupManagement.findTargetsOfRolloutGroup(Pageable.unpaged(), group.getId()).get())
|
||||
group -> rolloutGroupManagement.findTargetsOfRolloutGroup(group.getId(), Pageable.unpaged()).get())
|
||||
.toList();
|
||||
|
||||
assertThat(rolloutTargets).hasSize(updateTargets.size()).allMatch(
|
||||
|
||||
@@ -11,8 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.management;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.qameta.allure.Description;
|
||||
import io.qameta.allure.Feature;
|
||||
import io.qameta.allure.Story;
|
||||
@@ -28,19 +26,10 @@ import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleUpdatedE
|
||||
import org.eclipse.hawkbit.repository.event.remote.entity.TargetCreatedEvent;
|
||||
import org.eclipse.hawkbit.repository.jpa.AbstractJpaIntegrationTest;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.JpaRolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.Action;
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetWithActionStatus;
|
||||
import org.eclipse.hawkbit.repository.test.matcher.Expect;
|
||||
import org.eclipse.hawkbit.repository.test.matcher.ExpectEvents;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.domain.Sort.Direction;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Feature("Component Tests - Repository")
|
||||
@Story("Rollout Management")
|
||||
@@ -74,140 +63,13 @@ class RolloutGroupManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.countByRollout(NOT_EXIST_IDL), "Rollout");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.countTargetsOfRolloutsGroup(NOT_EXIST_IDL), "RolloutGroup");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findByRolloutWithDetailedStatus(PAGE, NOT_EXIST_IDL), "Rollout");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findAllTargetsOfRolloutGroupWithActionStatus(PAGE, NOT_EXIST_IDL), "RolloutGroup");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findByRolloutAndRsql(PAGE, NOT_EXIST_IDL, "name==*"), "Rollout");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findByRolloutWithDetailedStatus(NOT_EXIST_IDL, PAGE), "Rollout");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findByRolloutAndRsql(NOT_EXIST_IDL, "name==*", PAGE), "Rollout");
|
||||
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findTargetsOfRolloutGroup(PAGE, NOT_EXIST_IDL), "RolloutGroup");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findTargetsOfRolloutGroup(NOT_EXIST_IDL, PAGE), "RolloutGroup");
|
||||
verifyThrownExceptionBy(() -> rolloutGroupManagement.findTargetsOfRolloutGroupByRsql(PAGE, NOT_EXIST_IDL, "name==*"), "RolloutGroup");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verifies that the returned result considers the provided sort parameters.")
|
||||
void findAllTargetsOfRolloutGroupWithActionStatusConsidersSorting() {
|
||||
final Rollout rollout = testdataFactory.createAndStartRollout();
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, rollout.getId())
|
||||
.getContent();
|
||||
final RolloutGroup rolloutGroup = rolloutGroups.get(0);
|
||||
rolloutManagement.pauseRollout(rollout.getId());
|
||||
rolloutHandler.handleAll();
|
||||
final List<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(PAGE, rolloutGroup.getId())
|
||||
.getContent();
|
||||
Target targetCancelled = targets.get(0);
|
||||
final Action actionCancelled = deploymentManagement.findActionsByTarget(targetCancelled.getControllerId(), PAGE)
|
||||
.getContent().get(0);
|
||||
deploymentManagement.cancelAction(actionCancelled.getId());
|
||||
deploymentManagement.forceQuitAction(actionCancelled.getId());
|
||||
targetCancelled = reloadTarget(targetCancelled);
|
||||
Target targetCancelling = targets.get(1);
|
||||
final Action actionCancelling = deploymentManagement
|
||||
.findActionsByTarget(targetCancelling.getControllerId(), PAGE).getContent().get(0);
|
||||
deploymentManagement.cancelAction(actionCancelling.getId());
|
||||
targetCancelling = reloadTarget(targetCancelling);
|
||||
|
||||
final List<TargetWithActionStatus> targetsWithActionStatus = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(PageRequest.of(0, 500, Sort.by(Direction.DESC, "status")),
|
||||
rolloutGroup.getId())
|
||||
.getContent();
|
||||
assertThat(targetsWithActionStatus.get(0).getTarget()).isEqualTo(targetCancelling);
|
||||
assertThat(targetsWithActionStatus.get(1).getTarget()).isEqualTo(targetCancelled);
|
||||
|
||||
final List<TargetWithActionStatus> targetsWithActionStatusOrderedByNameDesc = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(PageRequest.of(0, 500, Sort.by(Direction.DESC, "name")),
|
||||
rolloutGroup.getId())
|
||||
.getContent();
|
||||
assertThatListIsSortedByTargetName(targetsWithActionStatusOrderedByNameDesc, Direction.DESC);
|
||||
|
||||
final List<TargetWithActionStatus> targetsWithActionStatusOrderedByNameAsc = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(PageRequest.of(0, 500, Sort.by(Direction.ASC, "name")),
|
||||
rolloutGroup.getId())
|
||||
.getContent();
|
||||
assertThatListIsSortedByTargetName(targetsWithActionStatusOrderedByNameAsc, Direction.ASC);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verifies that the returned result considers sorting by action status code.")
|
||||
void findAllTargetsOfRolloutGroupWithActionStatusConsidersSortingByLastActionStatusCode() {
|
||||
final Rollout rollout = testdataFactory.createAndStartRollout();
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, rollout.getId())
|
||||
.getContent();
|
||||
final RolloutGroup rolloutGroup = rolloutGroups.get(0);
|
||||
final List<Action> runningActions = findActionsByRolloutAndStatus(rollout, Status.RUNNING);
|
||||
final Target target0 = runningActions.get(0).getTarget();
|
||||
final Target target24 = CollectionUtils.lastElement(runningActions).getTarget();
|
||||
int i = 0;
|
||||
for (final Action action : runningActions) {
|
||||
controllerManagement.addUpdateActionStatus(
|
||||
entityFactory.actionStatus().create(action.getId()).status(Status.RUNNING).code(i++));
|
||||
}
|
||||
|
||||
List<TargetWithActionStatus> targetsWithActionStatus = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(
|
||||
PageRequest.of(0, 500, Sort.by(Direction.ASC, "lastActionStatusCode")),
|
||||
rolloutGroup.getId())
|
||||
.getContent();
|
||||
assertSortedListOfActionStatus(targetsWithActionStatus, target0, 0, target24, 24);
|
||||
assertThat(targetsWithActionStatus)
|
||||
.hasSize((int) rolloutGroupManagement.countTargetsOfRolloutsGroup(rolloutGroup.getId()));
|
||||
|
||||
targetsWithActionStatus = rolloutGroupManagement.findAllTargetsOfRolloutGroupWithActionStatus(
|
||||
PageRequest.of(0, 500, Sort.by(Direction.DESC, "lastActionStatusCode")), rolloutGroup.getId())
|
||||
.getContent();
|
||||
assertSortedListOfActionStatus(targetsWithActionStatus, target24, 24, target0, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Verifies that Rollouts in different states are handled correctly.")
|
||||
void findAllTargetsOfRolloutGroupWithActionStatus() {
|
||||
final Rollout rollout = testdataFactory.createRollout();
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, rollout.getId()).getContent();
|
||||
rolloutHandler.handleAll();
|
||||
|
||||
// check query when no actions exist
|
||||
final List<TargetWithActionStatus> targetsWithActionStatus = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(
|
||||
PageRequest.of(0, 500, Sort.by(Direction.DESC, "lastActionStatusCode")),
|
||||
rolloutGroups.get(0).getId())
|
||||
.getContent();
|
||||
assertThat(targetsWithActionStatus).hasSize((int) rolloutGroupManagement.countTargetsOfRolloutsGroup(rolloutGroups.get(0).getId()));
|
||||
assertTargetNotNullAndActionStatusNullAndActionStatusCode(targetsWithActionStatus, null);
|
||||
|
||||
rolloutManagement.start(rollout.getId());
|
||||
rolloutHandler.handleAll();
|
||||
|
||||
// check query when no action status code exist
|
||||
final List<Action> scheduledActions = findActionsByRolloutAndStatus(rollout, Status.SCHEDULED);
|
||||
final RolloutGroup rolloutGroupScheduled = scheduledActions.get(0).getRolloutGroup();
|
||||
|
||||
final List<TargetWithActionStatus> targetsWithActionStatusForScheduledRG = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(
|
||||
PageRequest.of(0, 500, Sort.by(Direction.DESC, "lastActionStatusCode")),
|
||||
rolloutGroupScheduled.getId())
|
||||
.getContent();
|
||||
assertThat(targetsWithActionStatusForScheduledRG)
|
||||
.hasSize((int) rolloutGroupManagement.countTargetsOfRolloutsGroup(rolloutGroupScheduled.getId()));
|
||||
assertTargetNotNullAndActionStatusAndActionStatusCode(targetsWithActionStatusForScheduledRG,
|
||||
Status.SCHEDULED, null);
|
||||
|
||||
final List<Action> runningActions = findActionsByRolloutAndStatus(rollout, Status.RUNNING);
|
||||
final RolloutGroup rolloutGroupRunning = runningActions.get(0).getRolloutGroup();
|
||||
for (final Action action : runningActions) {
|
||||
controllerManagement.addUpdateActionStatus(
|
||||
entityFactory.actionStatus().create(action.getId()).status(Status.RUNNING).code(100));
|
||||
}
|
||||
|
||||
// check query when action status code exists
|
||||
final List<TargetWithActionStatus> targetsWithActionStatusForRunningRG = rolloutGroupManagement
|
||||
.findAllTargetsOfRolloutGroupWithActionStatus(
|
||||
PageRequest.of(0, 500, Sort.by(Direction.DESC, "lastActionStatusCode")),
|
||||
rolloutGroupRunning.getId())
|
||||
.getContent();
|
||||
assertThat(targetsWithActionStatusForRunningRG)
|
||||
.hasSize((int) rolloutGroupManagement.countTargetsOfRolloutsGroup(rolloutGroupRunning.getId()));
|
||||
assertTargetNotNullAndActionStatusAndActionStatusCode(targetsWithActionStatusForRunningRG,
|
||||
Status.RUNNING, 100);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Description("Tests the rollout group status mapping.")
|
||||
void testRolloutGroupStatusConvert() {
|
||||
@@ -221,55 +83,4 @@ class RolloutGroupManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(rolloutGroupManagement.get(id).orElseThrow().getStatus()).isEqualTo(status);
|
||||
}
|
||||
}
|
||||
|
||||
private void assertSortedListOfActionStatus(final List<TargetWithActionStatus> targetsWithActionStatus,
|
||||
final Target first, final Integer firstStatusCode, final Target last, final Integer lastStatusCode) {
|
||||
assertTargetAndActionStatusCode(CollectionUtils.firstElement(targetsWithActionStatus), first, firstStatusCode);
|
||||
assertTargetAndActionStatusCode(CollectionUtils.lastElement(targetsWithActionStatus), last, lastStatusCode);
|
||||
}
|
||||
|
||||
private void assertTargetAndActionStatusCode(final TargetWithActionStatus targetWithActionStatus,
|
||||
final Target target, final Integer actionStatusCode) {
|
||||
assertThat(targetWithActionStatus.getTarget().getControllerId()).isEqualTo(target.getControllerId());
|
||||
assertThat(targetWithActionStatus.getLastActionStatusCode()).isEqualTo(actionStatusCode);
|
||||
}
|
||||
|
||||
private void assertTargetNotNullAndActionStatusNullAndActionStatusCode(
|
||||
final List<TargetWithActionStatus> targetsWithActionStatus, final Integer actionStatusCode) {
|
||||
targetsWithActionStatus.forEach(targetWithActionStatus -> {
|
||||
assertThat(targetWithActionStatus.getTarget().getControllerId()).isNotNull();
|
||||
assertThat(targetWithActionStatus.getStatus()).isNull();
|
||||
assertThat(targetWithActionStatus.getLastActionStatusCode()).isEqualTo(actionStatusCode);
|
||||
});
|
||||
}
|
||||
|
||||
private void assertTargetNotNullAndActionStatusAndActionStatusCode(
|
||||
final List<TargetWithActionStatus> targetsWithActionStatus, final Status actionStatus,
|
||||
final Integer actionStatusCode) {
|
||||
targetsWithActionStatus.forEach(targetWithActionStatus -> {
|
||||
assertThat(targetWithActionStatus.getTarget().getControllerId()).isNotNull();
|
||||
assertThat(targetWithActionStatus.getStatus()).isEqualTo(actionStatus);
|
||||
assertThat(targetWithActionStatus.getLastActionStatusCode()).isEqualTo(actionStatusCode);
|
||||
});
|
||||
}
|
||||
|
||||
private void assertThatListIsSortedByTargetName(final List<TargetWithActionStatus> targets,
|
||||
final Direction sortDirection) {
|
||||
String previousName = null;
|
||||
for (final TargetWithActionStatus targetWithActionStatus : targets) {
|
||||
final String actualName = targetWithActionStatus.getTarget().getName();
|
||||
if (previousName != null) {
|
||||
if (Direction.ASC == sortDirection) {
|
||||
assertThat(actualName).isGreaterThan(previousName);
|
||||
} else {
|
||||
assertThat(actualName).isLessThan(previousName);
|
||||
}
|
||||
}
|
||||
previousName = actualName;
|
||||
}
|
||||
}
|
||||
|
||||
private Target reloadTarget(final Target targetCancelled) {
|
||||
return targetManagement.get(targetCancelled.getId()).orElseThrow();
|
||||
}
|
||||
}
|
||||
@@ -58,8 +58,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
final Rollout rollout = testdataFactory.createRolloutByVariables(rolloutName, rolloutName, amountGroups,
|
||||
"controllerid==" + targetPrefix + "*", distributionSet, "60", "30", false, false);
|
||||
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
|
||||
// add 2 targets not to be included
|
||||
testdataFactory.createTargets(targetPrefix, amountGroups * 3, 2);
|
||||
@@ -101,8 +101,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
// rollout is READY
|
||||
assertRollout(rollout, true, RolloutStatus.READY, amountGroups + 1, amountGroups * 3);
|
||||
List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
final RolloutGroup dynamic1 = groups.get(amountGroups);
|
||||
assertRollout(rollout, true, RolloutStatus.READY, amountGroups + 1, amountGroups * 3); // + dynamic
|
||||
for (int i = 0; i < amountGroups; i++) {
|
||||
@@ -137,8 +137,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
assertRollout(rollout, true, RolloutStatus.RUNNING, amountGroups + 2, amountGroups * 3 + 3);
|
||||
assertGroup(dynamic1, true, RolloutGroupStatus.RUNNING, 3);
|
||||
groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
final RolloutGroup dynamic2 = groups.get(amountGroups + 1);
|
||||
assertGroup(dynamic2, true, RolloutGroupStatus.SCHEDULED, 0);
|
||||
|
||||
@@ -190,8 +190,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
// create third dynamic group
|
||||
rolloutHandler.handleAll();
|
||||
assertThat(rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent().size()).isEqualTo(amountGroups + 3);
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent().size()).isEqualTo(amountGroups + 3);
|
||||
executeAllFromGroup(rollout, dynamic1, 1);
|
||||
executeAllFromGroup(rollout, dynamic2, 3);
|
||||
assertAndGetRunning(rollout, 0);
|
||||
@@ -218,8 +218,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
// rollout is READY, amountGroups + 1 (dynamic) rollout groups and amountGroups * 3 targets in static groups
|
||||
assertRollout(rollout, true, RolloutStatus.READY, amountGroups + 1, amountGroups * 3);
|
||||
List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
final RolloutGroup dynamic1 = groups.get(amountGroups);
|
||||
assertRollout(rollout, true, RolloutStatus.READY, amountGroups + 1, amountGroups * 3); // + dynamic
|
||||
for (int i = 0; i < amountGroups; i++) {
|
||||
@@ -254,8 +254,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
assertRollout(rollout, true, RolloutStatus.RUNNING, amountGroups + 2, amountGroups * 3 + 6);
|
||||
assertGroup(dynamic1, true, RolloutGroupStatus.RUNNING, 6);
|
||||
groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
final RolloutGroup dynamic2 = groups.get(amountGroups + 1);
|
||||
assertGroup(dynamic2, true, RolloutGroupStatus.SCHEDULED, 0);
|
||||
|
||||
@@ -313,8 +313,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
// rollout is READY, amountGroups + 1 (dynamic) rollout groups and amountGroups * 3 targets in static groups
|
||||
assertRollout(rollout, true, RolloutStatus.READY, 1, 0);
|
||||
List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
final RolloutGroup dynamic1 = groups.get(0);
|
||||
assertRollout(rollout, true, RolloutStatus.READY, 1, 0); // + dynamic
|
||||
assertGroup(dynamic1, true, RolloutGroupStatus.READY, 0);
|
||||
@@ -341,8 +341,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
assertRollout(rollout, true, RolloutStatus.RUNNING, 2, 6);
|
||||
assertGroup(dynamic1, true, RolloutGroupStatus.RUNNING, 6);
|
||||
groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
final RolloutGroup dynamic2 = groups.get(1);
|
||||
assertGroup(dynamic2, true, RolloutGroupStatus.SCHEDULED, 0);
|
||||
|
||||
@@ -391,8 +391,8 @@ class RolloutManagementFlowTest extends AbstractJpaIntegrationTest {
|
||||
final Rollout rollout = testdataFactory.createRolloutByVariables(rolloutName, rolloutName, amountGroups,
|
||||
"controllerid==" + targetPrefix + "*", distributionSet, "0", "25", false, false);
|
||||
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
rollout.getId()).getContent();
|
||||
rollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
|
||||
// start rollout
|
||||
rolloutManagement.start(rollout.getId());
|
||||
|
||||
@@ -124,8 +124,8 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
rolloutHandler.handleAll();
|
||||
assertRollout(dynamicRollout, true, RolloutStatus.RUNNING, amountGroups + 1, amountGroups * 2);
|
||||
final List<RolloutGroup> dynamicGroups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
dynamicRollout.getId()).getContent();
|
||||
dynamicRollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
for (int i = 0; i < dynamicGroups.size(); i++) {
|
||||
final RolloutGroup group = dynamicGroups.get(i);
|
||||
if (i + 1 == dynamicGroups.size()) {
|
||||
@@ -159,8 +159,8 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
rolloutHandler.handleAll();
|
||||
assertRollout(staticRollout, false, RolloutStatus.RUNNING, amountGroups, amountGroups * 3);
|
||||
final List<RolloutGroup> staticGroups = rolloutGroupManagement.findByRollout(
|
||||
new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id")),
|
||||
staticRollout.getId()).getContent();
|
||||
staticRollout.getId(), new OffsetBasedPageRequest(0, amountGroups + 10, Sort.by(Direction.ASC, "id"))
|
||||
).getContent();
|
||||
staticGroups.forEach(group -> assertGroup(group, false, RolloutGroupStatus.RUNNING, 3));
|
||||
|
||||
rolloutManagement.resumeRollout(dynamicRollout.getId());
|
||||
@@ -331,7 +331,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
amountOtherTargets, amountGroups, successCondition, errorCondition);
|
||||
|
||||
// verify the split of the target and targetGroup
|
||||
final Page<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, createdRollout.getId());
|
||||
final Page<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(createdRollout.getId(), PAGE);
|
||||
// we have total of #amountTargetsForRollout in rollouts split in
|
||||
// group size #groupSize
|
||||
assertThat(rolloutGroups).hasSize(amountGroups);
|
||||
@@ -351,13 +351,13 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// verify first group is running
|
||||
final RolloutGroup firstGroup = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 1, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 1, Sort.by(Direction.ASC, "id")))
|
||||
.getContent().get(0);
|
||||
assertThat(firstGroup.getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
|
||||
// verify other groups are scheduled
|
||||
final List<RolloutGroup> scheduledGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(1, 100, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(1, 100, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
scheduledGroups.forEach(group -> assertThat(group.getStatus())
|
||||
.as("group which should be in scheduled state is in " + group.getStatus() + " state")
|
||||
@@ -398,7 +398,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// verify that now the first and the second group are in running state
|
||||
final List<RolloutGroup> runningRolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 2, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 2, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
runningRolloutGroups.forEach(group -> assertThat(group.getStatus())
|
||||
.as("group should be in running state because it should be started but it is in " + group.getStatus()
|
||||
@@ -407,7 +407,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// verify that the other groups are still in schedule state
|
||||
final List<RolloutGroup> scheduledRolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(2, 10, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(2, 10, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
scheduledRolloutGroups.forEach(group -> assertThat(group.getStatus())
|
||||
.as("group should be in scheduled state because it should not be started but it is in "
|
||||
@@ -470,14 +470,14 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// the first rollout group should be in error state
|
||||
final List<RolloutGroup> errorGroup = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 1, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 1, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
assertThat(errorGroup).hasSize(1);
|
||||
assertThat(errorGroup.get(0).getStatus()).isEqualTo(RolloutGroupStatus.ERROR);
|
||||
|
||||
// all other groups should still be in scheduled state
|
||||
final List<RolloutGroup> scheduleGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(1, 100, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(1, 100, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
scheduleGroups.forEach(group -> assertThat(group.getStatus()).isEqualTo(RolloutGroupStatus.SCHEDULED));
|
||||
}
|
||||
@@ -513,7 +513,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// all other groups should still be in scheduled state
|
||||
final List<RolloutGroup> scheduleGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(1, 100, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(1, 100, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
scheduleGroups.forEach(group -> assertThat(group.getStatus()).isEqualTo(RolloutGroupStatus.SCHEDULED));
|
||||
|
||||
@@ -528,7 +528,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// next group should be running again after resuming the rollout
|
||||
final List<RolloutGroup> resumedGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(1, 1, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(1, 1, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
assertThat(resumedGroups).hasSize(1);
|
||||
assertThat(resumedGroups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
@@ -564,7 +564,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// verify all groups are in finished state
|
||||
rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 100, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 100, Sort.by(Direction.ASC, "id")))
|
||||
.forEach(group -> assertThat(group.getStatus()).isEqualTo(RolloutGroupStatus.FINISHED));
|
||||
|
||||
// verify that rollout itself is in finished state
|
||||
@@ -763,7 +763,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
// round(5/2)=3 targets SCHEDULED (Group 3)
|
||||
// round(2/1)=2 targets SCHEDULED (Group 4)
|
||||
createdRollout = reloadRollout(createdRollout);
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, createdRollout.getId())
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(createdRollout.getId(), PAGE)
|
||||
.getContent();
|
||||
|
||||
Map<TotalTargetCountStatus.Status, Long> expectedTargetCountStatus = createInitStatusMap();
|
||||
@@ -804,10 +804,10 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(runningActions.size()).isEqualTo(5);
|
||||
|
||||
// 5 targets are in the group and the DS has been assigned
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, createdRollout.getId())
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(createdRollout.getId(), PAGE)
|
||||
.getContent();
|
||||
final Page<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(PAGE,
|
||||
rolloutGroups.get(0).getId());
|
||||
final Page<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(rolloutGroups.get(0).getId(), PAGE
|
||||
);
|
||||
final List<Target> targetList = targets.getContent();
|
||||
assertThat(targetList.size()).isEqualTo(5);
|
||||
|
||||
@@ -947,7 +947,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
changeStatusForRunningActions(rolloutOne, Status.FINISHED, 3);
|
||||
rolloutHandler.handleAll();
|
||||
// verify: 40% error but 60% finished -> should move to next group
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, rolloutOne.getId())
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(rolloutOne.getId(), PAGE)
|
||||
.getContent();
|
||||
final Map<TotalTargetCountStatus.Status, Long> expectedTargetCountStatus = createInitStatusMap();
|
||||
expectedTargetCountStatus.put(TotalTargetCountStatus.Status.RUNNING, 5L);
|
||||
@@ -974,7 +974,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
rolloutHandler.handleAll();
|
||||
// verify: 40% error and 60% finished -> should not move to next group
|
||||
// because successCondition 80%
|
||||
final List<RolloutGroup> rolloutGruops = rolloutGroupManagement.findByRollout(PAGE, rolloutOne.getId())
|
||||
final List<RolloutGroup> rolloutGruops = rolloutGroupManagement.findByRollout(rolloutOne.getId(), PAGE)
|
||||
.getContent();
|
||||
final Map<TotalTargetCountStatus.Status, Long> expectedTargetCountStatus = createInitStatusMap();
|
||||
expectedTargetCountStatus.put(TotalTargetCountStatus.Status.SCHEDULED, 5L);
|
||||
@@ -1184,7 +1184,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
float percent = rolloutGroupManagement
|
||||
.getWithDetailedStatus(
|
||||
rolloutGroupManagement.findByRollout(PAGE, myRollout.getId()).getContent().get(0).getId())
|
||||
rolloutGroupManagement.findByRollout(myRollout.getId(), PAGE).getContent().get(0).getId())
|
||||
.get().getTotalTargetCountStatus().getFinishedPercent();
|
||||
assertThat(percent).isEqualTo(40);
|
||||
|
||||
@@ -1193,7 +1193,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
percent = rolloutGroupManagement
|
||||
.getWithDetailedStatus(
|
||||
rolloutGroupManagement.findByRollout(PAGE, myRollout.getId()).getContent().get(0).getId())
|
||||
rolloutGroupManagement.findByRollout(myRollout.getId(), PAGE).getContent().get(0).getId())
|
||||
.get().getTotalTargetCountStatus().getFinishedPercent();
|
||||
assertThat(percent).isEqualTo(100);
|
||||
|
||||
@@ -1203,7 +1203,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
percent = rolloutGroupManagement
|
||||
.getWithDetailedStatus(
|
||||
rolloutGroupManagement.findByRollout(PAGE, myRollout.getId()).getContent().get(1).getId())
|
||||
rolloutGroupManagement.findByRollout(myRollout.getId(), PAGE).getContent().get(1).getId())
|
||||
.get().getTotalTargetCountStatus().getFinishedPercent();
|
||||
assertThat(percent).isEqualTo(80);
|
||||
}
|
||||
@@ -1234,7 +1234,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
"Target belongs into rollout");
|
||||
|
||||
myRollout = reloadRollout(myRollout);
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(PAGE, myRollout.getId())
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement.findByRollout(myRollout.getId(), PAGE)
|
||||
.getContent();
|
||||
|
||||
Page<Target> targetPage = rolloutGroupManagement.findTargetsOfRolloutGroupByRsql(
|
||||
@@ -1315,7 +1315,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(myRollout.getStatus()).isEqualTo(RolloutStatus.READY);
|
||||
|
||||
final Long myRolloutId = myRollout.getId();
|
||||
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(PAGE, myRolloutId).getContent();
|
||||
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(myRolloutId, PAGE).getContent();
|
||||
|
||||
assertThat(groups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.READY);
|
||||
assertThat(groups.get(0).getTotalTargets()).isEqualTo(1);
|
||||
@@ -1522,7 +1522,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
myRollout = getRollout(myRollout.getId());
|
||||
|
||||
assertThat(myRollout.getStatus()).isEqualTo(RolloutStatus.CREATING);
|
||||
for (final RolloutGroup group : rolloutGroupManagement.findByRollout(PAGE, myRollout.getId()).getContent()) {
|
||||
for (final RolloutGroup group : rolloutGroupManagement.findByRollout(myRollout.getId(), PAGE).getContent()) {
|
||||
assertThat(group.getStatus()).isEqualTo(RolloutGroupStatus.CREATING);
|
||||
}
|
||||
|
||||
@@ -1537,7 +1537,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(myRollout.getStatus()).isEqualTo(RolloutStatus.READY);
|
||||
assertThat(myRollout.getTotalTargets()).isEqualTo(amountTargetsInGroup2and3 + amountTargetsInGroup1);
|
||||
|
||||
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(PAGE, myRollout.getId()).getContent();
|
||||
final List<RolloutGroup> groups = rolloutGroupManagement.findByRollout(myRollout.getId(), PAGE).getContent();
|
||||
|
||||
assertThat(groups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.READY);
|
||||
assertThat(groups.get(0).getTotalTargets()).isEqualTo(amountTargetsInGroup1);
|
||||
@@ -1576,7 +1576,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
assertThat(getRollout(rolloutId)).satisfies(rollout -> {
|
||||
assertThat(rollout.getStatus()).isEqualTo(RolloutStatus.CREATING);
|
||||
for (final RolloutGroup group : rolloutGroupManagement.findByRollout(PAGE, rollout.getId()).getContent()) {
|
||||
for (final RolloutGroup group : rolloutGroupManagement.findByRollout(rollout.getId(), PAGE).getContent()) {
|
||||
assertThat(group.getStatus()).isEqualTo(RolloutGroupStatus.CREATING);
|
||||
}
|
||||
});
|
||||
@@ -1590,7 +1590,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
});
|
||||
|
||||
// verify created rollout groups
|
||||
final List<Long> rolloutGroupIds = rolloutGroupManagement.findByRollout(PAGE, rolloutId).getContent().stream()
|
||||
final List<Long> rolloutGroupIds = rolloutGroupManagement.findByRollout(rolloutId, PAGE).getContent().stream()
|
||||
.map(Identifiable::getId).collect(Collectors.toList());
|
||||
assertThat(rolloutGroupIds).hasSize(2);
|
||||
assertRolloutGroup(rolloutGroupIds.get(0), RolloutGroupStatus.READY, true, amountTargetsInGroup1, null);
|
||||
@@ -1855,7 +1855,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(rolloutManagement.findByRsql(PAGE, "name==*", true).getContent()).hasSize(1);
|
||||
assertThat(rolloutManagement.findByRsql(PAGE, "name==*", false).getContent()).isEmpty();
|
||||
assertThat(rolloutManagement.count()).isZero();
|
||||
assertThat(rolloutGroupManagement.findByRolloutWithDetailedStatus(PAGE, createdRollout.getId()).getContent())
|
||||
assertThat(rolloutGroupManagement.findByRolloutWithDetailedStatus(createdRollout.getId(), PAGE).getContent())
|
||||
.hasSize(amountGroups);
|
||||
|
||||
// verify that all scheduled actions are deleted
|
||||
@@ -2031,7 +2031,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
final Rollout testRollout = reloadRollout(createdRollout);
|
||||
final List<RolloutGroup> rolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(Pageable.unpaged(), testRollout.getId()).getContent();
|
||||
.findByRollout(testRollout.getId(), Pageable.unpaged()).getContent();
|
||||
|
||||
assertThat(testRollout.getStatus()).isEqualTo(RolloutStatus.READY);
|
||||
assertThat(testRollout.getTotalTargets()).isEqualTo(targets.size());
|
||||
@@ -2039,7 +2039,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(rolloutGroups.get(0).getTotalTargets()).isEqualTo(targets.size());
|
||||
|
||||
final List<Target> rolloutGroupTargets = rolloutGroupManagement
|
||||
.findTargetsOfRolloutGroup(Pageable.unpaged(), rolloutGroups.get(0).getId()).getContent();
|
||||
.findTargetsOfRolloutGroup(rolloutGroups.get(0).getId(), Pageable.unpaged()).getContent();
|
||||
|
||||
assertThat(rolloutGroupTargets).hasSize(targets.size()).containsExactlyInAnyOrderElementsOf(targets)
|
||||
.doesNotContainAnyElementsOf(incompatibleTargets);
|
||||
@@ -2062,7 +2062,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// second group should in running state
|
||||
List<RolloutGroup> rolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
assertThat(rolloutGroups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
assertThat(rolloutGroups.get(1).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
@@ -2073,7 +2073,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
// third group should be in running state
|
||||
rolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
assertThat(rolloutGroups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
assertThat(rolloutGroups.get(1).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
@@ -2190,7 +2190,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
private void checkSecondGroupStatusIsRunning(final Rollout createdRollout) {
|
||||
rolloutHandler.handleAll();
|
||||
final List<RolloutGroup> runningRolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")), createdRollout.getId())
|
||||
.findByRollout(createdRollout.getId(), new OffsetBasedPageRequest(0, 10, Sort.by(Direction.ASC, "id")))
|
||||
.getContent();
|
||||
assertThat(runningRolloutGroups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.FINISHED);
|
||||
assertThat(runningRolloutGroups.get(1).getStatus()).isEqualTo(RolloutGroupStatus.RUNNING);
|
||||
@@ -2223,7 +2223,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
private void verifyRolloutAndAllGroupsAreFinished(final Rollout createdRollout) {
|
||||
rolloutHandler.handleAll();
|
||||
final List<RolloutGroup> runningRolloutGroups = rolloutGroupManagement
|
||||
.findByRollout(PAGE, createdRollout.getId()).getContent();
|
||||
.findByRollout(createdRollout.getId(), PAGE).getContent();
|
||||
assertThat(runningRolloutGroups.get(0).getStatus()).isEqualTo(RolloutGroupStatus.FINISHED);
|
||||
assertThat(runningRolloutGroups.get(1).getStatus()).isEqualTo(RolloutGroupStatus.FINISHED);
|
||||
assertThat(runningRolloutGroups.get(2).getStatus()).isEqualTo(RolloutGroupStatus.FINISHED);
|
||||
@@ -2252,7 +2252,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
}
|
||||
|
||||
private void assertAllActionOfRolloutGroupHavingStatus(final long rolloutGroupId, final Status status) {
|
||||
final List<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(PAGE, rolloutGroupId)
|
||||
final List<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(rolloutGroupId, PAGE)
|
||||
.getContent();
|
||||
targets.forEach(target -> {
|
||||
final List<Action> activeActions = deploymentManagement
|
||||
@@ -2263,7 +2263,7 @@ class RolloutManagementTest extends AbstractJpaIntegrationTest {
|
||||
}
|
||||
|
||||
private void forceQuitAllActionsOfRolloutGroup(final long rolloutGroupId) {
|
||||
final List<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(PAGE, rolloutGroupId)
|
||||
final List<Target> targets = rolloutGroupManagement.findTargetsOfRolloutGroup(rolloutGroupId, PAGE)
|
||||
.getContent();
|
||||
targets.forEach(target -> {
|
||||
deploymentManagement.findActiveActionsByTarget(PAGE, target.getControllerId()).getContent().stream().map(Identifiable::getId)
|
||||
|
||||
@@ -42,7 +42,7 @@ public class RSQLRolloutGroupFieldTest extends AbstractJpaIntegrationTest {
|
||||
rollout = createRollout("rollout1", 4, dsA.getId(), "controllerId==rollout*");
|
||||
rollout = rolloutManagement.get(rollout.getId()).get();
|
||||
|
||||
this.rolloutGroupId = rolloutGroupManagement.findByRollout(PAGE, rollout.getId()).getContent().get(0).getId();
|
||||
this.rolloutGroupId = rolloutGroupManagement.findByRollout(rollout.getId(), PAGE).getContent().get(0).getId();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -85,8 +85,8 @@ public class RSQLRolloutGroupFieldTest extends AbstractJpaIntegrationTest {
|
||||
}
|
||||
|
||||
private void assertRSQLQuery(final String rsqlParam, final long expectedTargets) {
|
||||
final Page<RolloutGroup> findTargetPage = rolloutGroupManagement.findByRolloutAndRsql(PageRequest.of(0, 100),
|
||||
rollout.getId(), rsqlParam);
|
||||
final Page<RolloutGroup> findTargetPage = rolloutGroupManagement.findByRolloutAndRsql(rollout.getId(), rsqlParam, PageRequest.of(0, 100)
|
||||
);
|
||||
final long countTargetsAll = findTargetPage.getTotalElements();
|
||||
assertThat(findTargetPage).isNotNull();
|
||||
assertThat(countTargetsAll).isEqualTo(expectedTargets);
|
||||
|
||||
Reference in New Issue
Block a user