Skip to content

Commit

Permalink
Merge branch 'release/4.1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed May 29, 2024
2 parents 4f20ca6 + d5af367 commit 49ee895
Show file tree
Hide file tree
Showing 49 changed files with 268 additions and 128 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
Expand All @@ -35,7 +35,7 @@ jobs:
run: ./mvnw integration-test failsafe:verify -Pitest -B -T4

- name: Upload coverage information
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: "${{ secrets.CODECOV_TOKEN }}"

Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ jobs:
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
# - name: Get pip cache dir
# id: pip-cache
# run: echo "::set-output name=dir::$(pip cache dir)"
#
# - name: Cache dependencies
# uses: actions/cache@v3
# with:
# path: ${{ steps.pip-cache.outputs.dir }}
# key: ${{ runner.os }}-pip-${{ hashFiles('./docs/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-

- name: Install dependencies
run: python3 -m pip install -r ./docs/requirements.txt

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Create Release Notes Markdown
uses: docker://decathlon/release-notes-generator-action:3.1.5
env:
Expand All @@ -21,6 +22,7 @@ jobs:
echo "RELEASE_NOTES_FILE=$RELEASE_NOTES_FILE" >> $GITHUB_ENV
VERSION=$(echo ${{ github.event.milestone.title }} | cut -d' ' -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create a Draft Release Notes on GitHub
id: create_release
uses: actions/create-release@v1
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Setup JDK and Maven
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
OSS_CENTRAL_PASSWORD: "${{ secrets.SONATYPE_PASSWORD }}"

- name: Upload coverage information to CodeCov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: "${{ secrets.CODECOV_TOKEN }}"

Expand Down
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>4.1.4</version>
<version>4.1.5</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
24 changes: 12 additions & 12 deletions 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>4.1.4</version>
<version>4.1.5</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand All @@ -19,14 +19,14 @@

<properties>
<springboot.version>3.1.5</springboot.version>
<camunda-commons-typed-values.version>7.20.0</camunda-commons-typed-values.version>
<camunda-commons-typed-values.version>7.21.0</camunda-commons-typed-values.version>

<axon-bom.version>4.9.4</axon-bom.version>
<axon-kotlin.version>4.9.0</axon-kotlin.version>
<axon-gateway-extension.version>2.0.0</axon-gateway-extension.version>
<axon-gateway-extension.version>2.1.0</axon-gateway-extension.version>

<awaitility.version>4.2.0</awaitility.version>
<mockito-kotlin.version>5.2.1</mockito-kotlin.version>
<awaitility.version>4.2.1</awaitility.version>
<mockito-kotlin.version>5.3.1</mockito-kotlin.version>
<jgiven.version>1.3.1</jgiven.version>
<jgiven-kotlin.version>1.3.1.0</jgiven-kotlin.version>

Expand Down Expand Up @@ -311,7 +311,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<version>0.8.12</version>
<executions>
<execution>
<id>pre-unit-test</id>
Expand Down Expand Up @@ -372,7 +372,7 @@
<!-- java compiler -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<version>3.13.0</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
Expand Down Expand Up @@ -420,7 +420,7 @@
<!-- jar -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<configuration>
<archive>
<manifest>
Expand Down Expand Up @@ -565,7 +565,7 @@
<plugin>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>1.9.10</version>
<version>1.9.20</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -581,7 +581,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand All @@ -601,7 +601,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -620,7 +620,7 @@
<!-- Install -->
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
</plugin>
</plugins>
</pluginManagement>
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>4.1.4</version>
<version>4.1.5</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 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>4.1.4</version>
<version>4.1.5</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.holunda.polyflow.bus.jackson

import com.fasterxml.jackson.annotation.JsonAutoDetect

/**
* Allow serialization of all fields. (Also private fields!)
*/
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
class JsonAutoDetectAnyVisibility
2 changes: 1 addition & 1 deletion core/datapool/datapool-api/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>4.1.4</version>
<version>4.1.5</version>
</parent>

<artifactId>polyflow-datapool-api</artifactId>
Expand Down
5 changes: 2 additions & 3 deletions core/datapool/datapool-core/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>4.1.4</version>
<version>4.1.5</version>
</parent>

<artifactId>polyflow-datapool-core</artifactId>
Expand Down Expand Up @@ -40,12 +40,11 @@
<artifactId>dom4j</artifactId>
<version>2.1.4</version>
</dependency>

<dependency>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-bus-jackson</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.holunda.polyflow.datapool.core

import com.fasterxml.jackson.databind.ObjectMapper
import io.holunda.polyflow.bus.jackson.JsonAutoDetectAnyVisibility
import io.holunda.polyflow.datapool.core.business.CreateOrUpdateCommandHandler
import io.holunda.polyflow.datapool.core.business.DataEntryAggregate
import io.holunda.polyflow.datapool.core.business.upcaster.DataEntryCreatedEventUpcaster
Expand All @@ -13,6 +15,7 @@ import org.axonframework.eventsourcing.SnapshotTriggerDefinition
import org.axonframework.eventsourcing.Snapshotter
import org.axonframework.eventsourcing.eventstore.EventStore
import org.axonframework.messaging.annotation.ParameterResolverFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.context.annotation.Bean
Expand Down Expand Up @@ -98,5 +101,15 @@ class DataPoolCoreAxonConfiguration {
*/
@Bean(DATA_ENTRY_CACHE)
fun dataEntryCache(): Cache = WeakReferenceCache()

@Autowired
fun configureJackson(objectMapper: ObjectMapper) {
objectMapper.configurePolyflowJacksonObjectMapperForDatapool()
}
}

fun ObjectMapper.configurePolyflowJacksonObjectMapperForDatapool(): ObjectMapper {
addMixIn(DataEntryAggregate::class.java, JsonAutoDetectAnyVisibility::class.java)
return this
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package io.holunda.polyflow.datapool.core.business

import com.fasterxml.jackson.databind.ObjectMapper
import io.holunda.camunda.taskpool.api.business.*
import io.holunda.polyflow.bus.jackson.JsonAutoDetectAnyVisibility
import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper
import io.holunda.polyflow.datapool.core.DeletionStrategy
import io.holunda.polyflow.datapool.core.configurePolyflowJacksonObjectMapperForDatapool
import org.assertj.core.api.Assertions
import org.assertj.core.api.Assertions.assertThat
import org.axonframework.eventsourcing.AggregateDeletedException
import org.axonframework.test.aggregate.AggregateTestFixture
import org.camunda.bpm.engine.variable.Variables
Expand Down Expand Up @@ -353,5 +359,53 @@ class DataEntryAggregateTest {
)
}

@Test
fun `should serialize and deserialize an empty aggregate`() {
// GIVEN an object mapper and an empty aggregate
val objectMapper = ObjectMapper().configurePolyflowJacksonObjectMapper()
val dataEntryAggregate = DataEntryAggregate()

// WHEN we serialize and deserialize it
val serializedObj = objectMapper.writeValueAsString(dataEntryAggregate)
objectMapper.readValue(serializedObj, DataEntryAggregate::class.java)

// THEN no problem should occur
}

@Test
fun `should serialize and deserialize an aggregate with data`() {
// GIVEN an object mapper and a filled aggregate
val objectMapper = ObjectMapper()
.configurePolyflowJacksonObjectMapper()
.configurePolyflowJacksonObjectMapperForDatapool()

val dataEntryAggregate = DataEntryAggregate().apply {
on(
DataEntryCreatedEvent(
entryId = UUID.randomUUID().toString(),
entryType = "io.holunda.My",
name = "Some name",
type = "Another",
applicationName = "Different application",
)
)
}
val dataIdentityValue = dataEntryAggregate.getDataIdentityValueForTest()

// WHEN we serialize and deserialize it
val serializedObj = objectMapper.writeValueAsString(dataEntryAggregate)
val deserializedObj = objectMapper.readValue(serializedObj, DataEntryAggregate::class.java)

// THEN no problem should occur
assertThat(deserializedObj.getDataIdentityValueForTest()).isEqualTo(dataIdentityValue)
}

}

private fun DataEntryAggregate.getDataIdentityValueForTest(): String? {
return javaClass.getDeclaredField("dataIdentity").let {
it.isAccessible = true
val value = it.get(this) as String?
return@let value
}
}
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>4.1.4</version>
<version>4.1.5</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 @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>4.1.4</version>
<version>4.1.5</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/spring-utils/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>4.1.4</version>
<version>4.1.5</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/taskpool/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>4.1.4</version>
<version>4.1.5</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/taskpool/taskpool-api/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-taskpool-parent</artifactId>
<version>4.1.4</version>
<version>4.1.5</version>
</parent>

<artifactId>polyflow-taskpool-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/taskpool/taskpool-core/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-taskpool-parent</artifactId>
<version>4.1.4</version>
<version>4.1.5</version>
</parent>

<artifactId>polyflow-taskpool-core</artifactId>
Expand Down
Loading

0 comments on commit 49ee895

Please sign in to comment.