Remove deprecated (#2800)
* ActionFields.DETAILSTATUS removed and replaces with STATUS (so status is with changed semantic - not active but real status) * MgmtAction.detailStatus removed and replaced with status (so status is with changed semantic - not active but real status) * MgmtTargetTagRestApi.assignTargetsPut removed - use POST method * ActionStatusFields.REPORTEDAT deprecation removed - it is a synonym of CREATEDAT but is part of timestamp/reported aspect while createdat is part of creted at/by * MgmtDistributionSetRequestBodyPost.os/runtime/application is removed and * ActionStatusFields.TIMESTAMPT added Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -203,12 +203,12 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest {
|
||||
final Long actionId = getFirstAssignedActionId(assignDistributionSet(testDs, testTarget));
|
||||
|
||||
controllerManagement.addUpdateActionStatus(ActionStatusCreate.builder().actionId(actionId)
|
||||
.status(Action.Status.RUNNING).occurredAt(System.currentTimeMillis()).messages(List.of("proceeding message 1"))
|
||||
.status(Action.Status.RUNNING).timestamp(System.currentTimeMillis()).messages(List.of("proceeding message 1"))
|
||||
.build());
|
||||
|
||||
waitNextMillis();
|
||||
controllerManagement.addUpdateActionStatus(ActionStatusCreate.builder().actionId(actionId)
|
||||
.status(Action.Status.RUNNING).occurredAt(System.currentTimeMillis()).messages(List.of("proceeding message 2"))
|
||||
.status(Action.Status.RUNNING).timestamp(System.currentTimeMillis()).messages(List.of("proceeding message 2"))
|
||||
.build());
|
||||
|
||||
final List<String> messages = controllerManagement.getActionHistoryMessages(actionId, 2);
|
||||
@@ -242,7 +242,7 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(actionId1).isNotNull();
|
||||
final ActionStatusCreateBuilder status = ActionStatusCreate.builder().actionId(actionId1).status(Status.WARNING);
|
||||
for (int i = 0; i < maxStatusEntries; i++) {
|
||||
controllerManagement.addInformationalActionStatus(status.messages(List.of("Msg " + i)).occurredAt(System.currentTimeMillis()).build());
|
||||
controllerManagement.addInformationalActionStatus(status.messages(List.of("Msg " + i)).timestamp(System.currentTimeMillis()).build());
|
||||
}
|
||||
final ActionStatusCreate actionStatusCreate = status.build();
|
||||
assertThatExceptionOfType(AssignmentQuotaExceededException.class)
|
||||
@@ -254,7 +254,7 @@ class ControllerManagementTest extends AbstractJpaIntegrationTest {
|
||||
assertThat(actionId2).isNotEqualTo(actionId1);
|
||||
final ActionStatusCreateBuilder statusWarning = ActionStatusCreate.builder().actionId(actionId2).status(Status.WARNING);
|
||||
for (int i = 0; i < maxStatusEntries; i++) {
|
||||
controllerManagement.addUpdateActionStatus(statusWarning.messages(List.of("Msg " + i)).occurredAt(System.currentTimeMillis()).build());
|
||||
controllerManagement.addUpdateActionStatus(statusWarning.messages(List.of("Msg " + i)).timestamp(System.currentTimeMillis()).build());
|
||||
}
|
||||
final ActionStatusCreate actionStatusCreateQE = statusWarning.build();
|
||||
assertThatExceptionOfType(AssignmentQuotaExceededException.class)
|
||||
|
||||
@@ -66,6 +66,20 @@ class RsqlActionFieldsTest extends AbstractJpaIntegrationTest {
|
||||
|
||||
assertRSQLQuery(ActionFields.ID.name() + "=in=(" + action.getId() + ",10000000)", 1);
|
||||
assertRSQLQuery(ActionFields.ID.name() + "=out=(" + action.getId() + ",10000000)", 10);
|
||||
}/**
|
||||
* Test action by status
|
||||
*/
|
||||
@Test
|
||||
void testFilterByParameterActive() {
|
||||
assertRSQLQuery(ActionFields.ACTIVE.name() + "==" + true, 5);
|
||||
assertRSQLQuery(ActionFields.ACTIVE.name() + "!=" + true, 6);
|
||||
assertRSQLQuery(ActionFields.ACTIVE.name() + "=in=(" + true + ")", 5);
|
||||
assertRSQLQuery(ActionFields.ACTIVE.name() + "=out=(" + true +")", 6);
|
||||
|
||||
final String rsql = ActionFields.ACTIVE.name() + "==true2";
|
||||
assertThatExceptionOfType(QueryException.class)
|
||||
.as("RSQLParameterUnsupportedFieldException because active cannot be compared with 'true2'")
|
||||
.isThrownBy(() -> assertRSQLQuery(rsql, 5));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,14 +87,14 @@ class RsqlActionFieldsTest extends AbstractJpaIntegrationTest {
|
||||
*/
|
||||
@Test
|
||||
void testFilterByParameterStatus() {
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "==pending", 5);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "!=pending", 6);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "=in=(pending)", 5);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "=out=(pending)", 6);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "==" + Status.RUNNING, 5);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "!=" + Status.RUNNING, 6);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "=in=(" + Status.RUNNING + ")", 5);
|
||||
assertRSQLQuery(ActionFields.STATUS.name() + "=out=(" + Status.RUNNING +")", 6);
|
||||
|
||||
final String rsql = ActionFields.STATUS.name() + "==true2";
|
||||
final String rsql = ActionFields.STATUS.name() + "==not_a_status";
|
||||
assertThatExceptionOfType(QueryException.class)
|
||||
.as("RSQLParameterUnsupportedFieldException because status cannot be compared with 'true'")
|
||||
.as("RSQLParameterUnsupportedFieldException because status cannot be compared with 'not_a_status'")
|
||||
.isThrownBy(() -> assertRSQLQuery(rsql, 5));
|
||||
}
|
||||
|
||||
@@ -99,7 +113,7 @@ class RsqlActionFieldsTest extends AbstractJpaIntegrationTest {
|
||||
newAction.setActionType(ActionType.SOFT);
|
||||
newAction.setDistributionSet(dsA);
|
||||
newAction.setActive(active);
|
||||
newAction.setStatus(Status.RUNNING);
|
||||
newAction.setStatus(active ? Status.RUNNING : Status.FINISHED);
|
||||
newAction.setTarget(target);
|
||||
newAction.setWeight(45);
|
||||
newAction.setInitiatedBy(tenantAware.getCurrentUsername());
|
||||
|
||||
Reference in New Issue
Block a user