Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tijsrademakers committed Jul 8, 2024
1 parent 0fe4170 commit b66f0e1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.flowable.cmmn.engine.impl.persistence.entity.PlanItemInstanceEntityImpl;
import org.flowable.cmmn.engine.impl.persistence.entity.SentryPartInstanceEntityImpl;
import org.flowable.common.engine.impl.persistence.entity.ByteArrayEntityImpl;
import org.flowable.common.engine.impl.persistence.entity.ChangeLogEntityImpl;
import org.flowable.common.engine.impl.persistence.entity.Entity;
import org.flowable.common.engine.impl.persistence.entity.PropertyEntityImpl;
import org.flowable.entitylink.service.impl.persistence.entity.EntityLinkEntityImpl;
Expand Down Expand Up @@ -63,6 +64,7 @@ public class EntityDependencyOrder {
static {

DELETE_ORDER.add(PropertyEntityImpl.class);
DELETE_ORDER.add(ChangeLogEntityImpl.class);
DELETE_ORDER.add(BatchPartEntityImpl.class);
DELETE_ORDER.add(BatchEntityImpl.class);
DELETE_ORDER.add(JobEntityImpl.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Collections;
import java.util.List;

import org.flowable.common.engine.impl.persistence.entity.ChangeLogEntityImpl;
import org.flowable.common.engine.impl.persistence.entity.Entity;
import org.flowable.common.engine.impl.persistence.entity.PropertyEntityImpl;
import org.flowable.dmn.engine.impl.persistence.entity.DecisionEntityImpl;
Expand All @@ -31,6 +32,7 @@ public class EntityDependencyOrder {
static {

DELETE_ORDER.add(PropertyEntityImpl.class);
DELETE_ORDER.add(ChangeLogEntityImpl.class);
DELETE_ORDER.add(HistoricDecisionExecutionEntityImpl.class);
DELETE_ORDER.add(DmnResourceEntityImpl.class);
DELETE_ORDER.add(DmnDeploymentEntityImpl.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- CHANGELOG SELECT -->

<resultMap id="changeLogResultMap" type="org.flowable.common.engine.impl.persistence.entity.ChangeLogEntityImpl">
<id property="id" column="ID" jdbcType="NVARCHAR" />
<id property="id" column="ID" jdbcType="VARCHAR" />
</resultMap>

<select id="selectCmmnChangeLogVersions" resultMap="changeLogResultMap">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Collections;
import java.util.List;

import org.flowable.common.engine.impl.persistence.entity.ChangeLogEntityImpl;
import org.flowable.common.engine.impl.persistence.entity.Entity;
import org.flowable.common.engine.impl.persistence.entity.PropertyEntityImpl;
import org.flowable.eventregistry.impl.persistence.entity.ChannelDefinitionEntityImpl;
Expand All @@ -31,6 +32,7 @@ public class EntityDependencyOrder {
static {

DELETE_ORDER.add(PropertyEntityImpl.class);
DELETE_ORDER.add(ChangeLogEntityImpl.class);
DELETE_ORDER.add(EventResourceEntityImpl.class);
DELETE_ORDER.add(EventDeploymentEntityImpl.class);
DELETE_ORDER.add(EventDefinitionEntityImpl.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
* @author Joram Barrez
*/
public class EngineMappingsValidationTest {

private static final List<String> NON_CREATE_ENTITIES = Arrays.asList(
"ChangeLog");

private static final List<String> IMMUTABLE_ENTITIES = Arrays.asList(
"HistoricIdentityLink",
Expand All @@ -63,7 +66,8 @@ public class EngineMappingsValidationTest {
"EventLogEntry",
"Privilege",
"PrivilegeMapping",
"Membership");
"Membership",
"ChangeLog");

@ParameterizedTest(name = "Package {0}")
@ArgumentsSource(EntityPackageTestArgumentsProvider.class)
Expand Down Expand Up @@ -100,7 +104,8 @@ public void verifyInserts(EntityMappingPackageInformation packageInformation) {
Document mappingFileContent = mappedResources.get(resource);

Class<?> entityClass = getAndAssertEntityImplClass(mappingFileContent, resource);
if (Modifier.isAbstract(entityClass.getModifiers())) {
if (Modifier.isAbstract(entityClass.getModifiers())
|| NON_CREATE_ENTITIES.contains(resource)) { // these entities have no insert
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public abstract class EntityParameterTypesOverview {
addProcessDefinitionParams();
addProcessDefinitionInfoParams();
addPropertyParams();
addChangeLogParams();
addResourceParams();
addTaskParams();
addTimerJobParams();
Expand Down Expand Up @@ -717,6 +718,11 @@ protected static void addPropertyParams() {
info.addColumn("VALUE_", "value", PARAMETER_TYPE_NVARCHAR);
info.addColumn("REV_", "revision", PARAMETER_TYPE_INTEGER);
}

protected static void addChangeLogParams() {
ParameterInfo info = addParameterInfo("changeLog");
info.addColumn("ID", "id", PARAMETER_TYPE_VARCHAR);
}

protected static void addResourceParams() {
ParameterInfo info = addParameterInfo("resource");
Expand Down

0 comments on commit b66f0e1

Please sign in to comment.