Skip to content

Commit

Permalink
Merge branch 'release/3.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Feb 15, 2023
2 parents ce4f436 + ab9406f commit 82bab59
Show file tree
Hide file tree
Showing 48 changed files with 382 additions and 56 deletions.
2 changes: 1 addition & 1 deletion bom/datapool-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion bom/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-root</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion bom/taskpool-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
8 changes: 7 additions & 1 deletion core/bus-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -71,5 +71,11 @@
<artifactId>jackson-datatype-jsr310</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@ import com.fasterxml.jackson.databind.ObjectMapper
import io.holunda.camunda.taskpool.api.business.AuthorizationChange
import io.holunda.camunda.taskpool.api.task.SourceReference
import io.holunda.polyflow.view.filter.Criterion
import io.holunda.polyflow.view.query.process.variable.ProcessVariableFilter

/**
* Configures object mapper.
*/
fun ObjectMapper.configurePolyflowJacksonObjectMapper(): ObjectMapper = this
/*
* List all custom modules.
*/
.registerModule(VariableMapTypeMappingModule())
.registerModule(DataEntryStateTypeMappingModule())
.apply {
/*
* List here all interfaces used in messages, which have multiple implementations and require additional
* type descriminator.
*/
addMixIn(SourceReference::class.java, KotlinTypeInfo::class.java)
addMixIn(AuthorizationChange::class.java, KotlinTypeInfo::class.java)
addMixIn(Criterion::class.java, KotlinTypeInfo::class.java)
addMixIn(ProcessVariableFilter::class.java, KotlinTypeInfo::class.java)
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package io.holunda.polyflow.view.query.data

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper
import io.holunda.polyflow.view.auth.User
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import java.util.stream.Stream

/**
* Test to make sure all queries and responses are deserializable.
*/
internal class DataEntryQueriesDeserializationTest {

private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper()

companion object {
@JvmStatic
fun provideDataEntryQueries(): Stream<Arguments> = Stream.of(
Arguments.of(
DataEntryForIdentityQuery::class.java,
DataEntryForIdentityQuery(entryId = "4711", entryType = "domain.type")
), Arguments.of(
DataEntryForIdentityQuery::class.java,
DataEntryForIdentityQuery(QueryDataIdentity(entryId = "4711", entryType = "domain.type"))
),

Arguments.of(
DataEntriesForUserQuery::class.java,
DataEntriesForUserQuery(
user = User(
username = "kermit", groups = setOf("muppets")
), page = 1, size = 50, sort = "+name", filters = listOf("data.name=test")
)
), Arguments.of(
DataEntriesForDataEntryTypeQuery::class.java,
DataEntriesForDataEntryTypeQuery(
entryType = "domain.type", page = 1, size = 50, sort = "+name"
)
)
)
}

@ParameterizedTest
@MethodSource("provideDataEntryQueries")
fun <Q : Any> `checks serialization is not changing the query`(type: Class<Q>, query: Q) {
val serialized = objectMapper.writeValueAsString(query)
val deserialized: Q = objectMapper.readValue(serialized, type)
assertThat(deserialized).isEqualTo(deserialized)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.holunda.polyflow.view.query.process

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper
import io.holunda.polyflow.view.auth.User
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import java.util.stream.Stream

/**
* Test to make sure all queries and responses are deserializable.
*/
internal class ProcessDefinitionQueriesDeserializationTest {

private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper()

companion object {
@JvmStatic
fun provideProcessDefinitionQueries(): Stream<Arguments> = Stream.of(
Arguments.of(
ProcessDefinitionsStartableByUserQuery::class.java,
ProcessDefinitionsStartableByUserQuery(
user = User(username = "kermit", groups = setOf("muppets"))
)
),
)
}

@ParameterizedTest
@MethodSource("provideProcessDefinitionQueries")
fun <Q : Any> `checks serialization is not changing the query`(type: Class<Q>, query: Q) {
val serialized = objectMapper.writeValueAsString(query)
val deserialized: Q = objectMapper.readValue(serialized, type)
assertThat(deserialized).isEqualTo(deserialized)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package io.holunda.polyflow.view.query.process

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper
import io.holunda.polyflow.view.ProcessInstanceState
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import java.util.stream.Stream

/**
* Test to make sure all queries and responses are deserializable.
*/
internal class ProcessInstanceQueriesDeserializationTest {

private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper()

companion object {
@JvmStatic
fun provideProcessInstanceQueries(): Stream<Arguments> = Stream.of(
Arguments.of(
ProcessInstancesByStateQuery::class.java,
ProcessInstancesByStateQuery(states = setOf(ProcessInstanceState.FINISHED, ProcessInstanceState.CANCELLED))
),
)
}

@ParameterizedTest
@MethodSource("provideProcessInstanceQueries")
fun <Q : Any> `checks serialization is not changing the query`(type: Class<Q>, query: Q) {
val serialized = objectMapper.writeValueAsString(query)
val deserialized: Q = objectMapper.readValue(serialized, type)
assertThat(deserialized).isEqualTo(deserialized)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package io.holunda.polyflow.view.query.process.variable

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper
import io.holunda.polyflow.view.query.process.variable.filter.ProcessVariableFilterExactlyOne
import io.holunda.polyflow.view.query.process.variable.filter.ProcessVariableFilterOneOf
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import java.util.stream.Stream

/**
* Test to make sure all queries and responses are deserializable.
*/
internal class ProcessInstanceQueriesDeserializationTest {

private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper()

companion object {
@JvmStatic
fun provideProcessVariableQueries(): Stream<Arguments> = Stream.of(
Arguments.of(
ProcessVariablesForInstanceQuery::class.java,
ProcessVariablesForInstanceQuery(
processInstanceId = "4712",
variableFilter = listOf(
ProcessVariableFilterOneOf(setOf("var1", "var2")),
ProcessVariableFilterExactlyOne("var3")
)
)
),
)
}

@ParameterizedTest
@MethodSource("provideProcessVariableQueries")
fun <Q : Any> `checks serialization is not changing the query`(type: Class<Q>, query: Q) {
val serialized = objectMapper.writeValueAsString(query)
val deserialized: Q = objectMapper.readValue(serialized, type)
assertThat(deserialized).isEqualTo(deserialized)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package io.holunda.polyflow.view.query.task

import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper
import io.holunda.polyflow.view.auth.User
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.Arguments
import org.junit.jupiter.params.provider.MethodSource
import java.util.stream.Stream

/**
* Test to make sure all queries and responses are deserializable.
*/
internal class TaskQueriesDeserializationTest {

private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper()

companion object {
@JvmStatic
fun provideTaskQueries() = Stream.of(
Arguments.of(
AllTasksQuery::class.java,
AllTasksQuery(
page = 1,
size = 50,
sort = "+name",
filters = listOf("task.name=test")
)
),
Arguments.of(
AllTasksWithDataEntriesQuery::class.java,
AllTasksWithDataEntriesQuery(
page = 1,
size = 50,
sort = "+name",
filters = listOf("task.name=test")
)
),
Arguments.of(
TaskCountByApplicationQuery::class.java,
TaskCountByApplicationQuery()
),
Arguments.of(
TaskForIdQuery::class.java,
TaskForIdQuery(id = "4712")
),
Arguments.of(
TasksForApplicationQuery::class.java,
TasksForApplicationQuery(applicationName = "appl")
),
Arguments.of(
TasksForGroupQuery::class.java,
TasksForGroupQuery(
user = User(username = "kermit", groups = setOf("muppets")),
page = 1,
size = 50,
sort = "+name",
filters = listOf("task.name=test")
)
),
Arguments.of(
TasksForUserQuery::class.java,
TasksForUserQuery(
user = User(username = "kermit", groups = setOf("muppets")),
page = 1,
size = 50,
sort = "+name",
filters = listOf("task.name=test")
)
),
Arguments.of(
TasksWithDataEntriesForGroupQuery::class.java,
TasksWithDataEntriesForGroupQuery(
user = User(username = "kermit", groups = setOf("muppets")),
page = 1,
size = 50,
sort = "+name",
filters = listOf("task.name=test")
)
),
Arguments.of(
TasksWithDataEntriesForUserQuery::class.java,
TasksWithDataEntriesForUserQuery(
user = User(username = "kermit", groups = setOf("muppets")),
page = 1,
size = 50,
sort = "+name",
filters = listOf("task.name=test")
)
),
Arguments.of(
TaskWithDataEntriesForIdQuery::class.java,
TaskWithDataEntriesForIdQuery(
id = "4713"
)
),
)
}

@ParameterizedTest
@MethodSource("provideTaskQueries")
fun <Q : Any> `checks serialization is not changing the query`(type: Class<Q>, query: Q) {
val serialized = objectMapper.writeValueAsString(query)
val deserialized: Q = objectMapper.readValue(serialized, type)
assertThat(deserialized).isEqualTo(query)
}
}
2 changes: 1 addition & 1 deletion core/datapool/datapool-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>polyflow-datapool-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/datapool/datapool-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>polyflow-datapool-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/datapool/datapool-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<artifactId>polyflow-datapool-event</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/datapool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.0</version>
<version>3.8.1</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
Loading

0 comments on commit 82bab59

Please sign in to comment.