public void testRemoveDescriptorMigration()

in timescaledb-connector/src/integration-test/java/com/epam/deltix/timebase/connector/service/timescale/TimescaleMigrationServiceTest.java [106:134]


    public void testRemoveDescriptorMigration() {
        applyTimescaleSchema();

        SchemaChangeMessage changeMessage = new SchemaChangeMessage();
        SchemaDescriptorChangeAction addDescriptorAction = new SchemaDescriptorChangeAction();
        addDescriptorAction.setChangeTypes(SchemaDescriptorChangeType.DELETE);

        ObjectArrayList<ClassDescriptorInfo> previousState = getDescriptorMessages();
        ObjectArrayList<ClassDescriptorInfo> newState = previousState.stream()
                .filter(d -> !d.getName().equals("com.epam.deltix.timebase.connector.model.SecondTestClass"))
                .collect(Collectors.toCollection(ObjectArrayList::new));

        changeMessage.setPreviousState(previousState);
        changeMessage.setNewState(newState);

        ClassDescriptorInfo descriptorToRemove = previousState.stream()
                .filter(d -> d.getName().equals("com.epam.deltix.timebase.connector.model.SecondTestClass"))
                .findAny()
                .get();

        addDescriptorAction.setPreviousState(descriptorToRemove);

        ObjectArrayList<SchemaDescriptorChangeActionInfo> actions = new ObjectArrayList<>();
        actions.add(addDescriptorAction);

        changeMessage.setDescriptorChangeActions(actions);

        migrationService.apply(changeMessage, "events");
    }