-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate to spring boot 3 and camunda 7.20
- Loading branch information
1 parent
59ea3bf
commit 7e4ba3e
Showing
92 changed files
with
726 additions
and
622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
11.0 | ||
17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
example/camunda-7-delegate/src/test/kotlin/KotlinLibTemplateITest.kt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
example/camunda-7-delegate/src/test/kotlin/KotlinLibTemplateTest.kt
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
...t/kotlin/io/holunda/camunda/worker/example/infrastructure/AdapterTypeSerializationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.holunda.camunda.worker.example.infrastructure | ||
|
||
import io.github.projectmapk.jackson.module.kogera.readValue | ||
import io.holunda.camunda.worker.example.ExampleProcess7DelegateApplication | ||
import io.holunda.camunda.worker.example.adapter.`in`.rest.OrderPositionDto | ||
import io.holunda.camunda.worker.example.adapter.`in`.rest.submit.OrderSubmissionDto | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.Test | ||
import java.time.Instant | ||
import java.util.* | ||
|
||
|
||
internal class AdapterTypeSerializationTest { | ||
|
||
private val objectMapper = ExampleProcess7DelegateApplication().objectMapper() | ||
private val orderSubmission = OrderSubmissionDto( | ||
created = Date.from(Instant.parse("2023-11-23T10:00:00Z")), | ||
positions = listOf( | ||
OrderPositionDto( | ||
title = "pen", | ||
netCost = "10.00", | ||
amount = 2L | ||
), | ||
OrderPositionDto( | ||
title = "pencil", | ||
netCost = "12.00", | ||
amount = 2L | ||
) | ||
) | ||
) | ||
private val expectedJson = | ||
"{\"created\":\"2023-11-23T10:00:00.000+00:00\",\"positions\":[{\"title\":\"pen\",\"netCost\":\"10.00\",\"amount\":2},{\"title\":\"pencil\",\"netCost\":\"12.00\",\"amount\":2}]}" | ||
|
||
|
||
@Test | ||
fun `should serialize to JSON and deserialize back`() { | ||
val json = objectMapper.writeValueAsString(orderSubmission) | ||
assertThat(json).isEqualTo(expectedJson) | ||
val back = objectMapper.readValue<OrderSubmissionDto>(json) | ||
assertThat(back).isEqualTo(orderSubmission) | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...st/kotlin/io/holunda/camunda/worker/example/infrastructure/DomainTypeSerializationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package io.holunda.camunda.worker.example.infrastructure | ||
|
||
import io.github.projectmapk.jackson.module.kogera.readValue | ||
import io.holunda.camunda.worker.example.domain.approval.Order | ||
import io.holunda.camunda.worker.example.domain.approval.OrderId | ||
import io.holunda.camunda.worker.example.domain.approval.OrderPosition | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat | ||
import org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatProvider | ||
import org.junit.jupiter.api.BeforeEach | ||
import org.junit.jupiter.api.Test | ||
import java.math.BigDecimal | ||
import java.time.Instant | ||
import java.util.* | ||
|
||
|
||
internal class DomainTypeSerializationTest { | ||
|
||
private val serverDataFormat = JacksonJsonDataFormatProvider().createInstance() as JacksonJsonDataFormat | ||
|
||
private val order = Order( | ||
orderId = OrderId("cdb43a24-4378-475a-8fa9-5bef51160e33"), | ||
created = Date.from(Instant.parse("2023-11-23T10:00:00Z")), | ||
positions = listOf( | ||
OrderPosition( | ||
title = "pen", | ||
netCost = BigDecimal.valueOf(10.00), | ||
amount = 2L | ||
), | ||
OrderPosition( | ||
title = "pencil", | ||
netCost = BigDecimal.valueOf(12.00), | ||
amount = 2L | ||
) | ||
) | ||
) | ||
private val expectedJson = | ||
"{\"orderId\":\"cdb43a24-4378-475a-8fa9-5bef51160e33\",\"created\":\"2023-11-23T10:00:00.000+00:00\",\"positions\":[{\"title\":\"pen\",\"netCost\":10.0,\"amount\":2},{\"title\":\"pencil\",\"netCost\":12.0,\"amount\":2}]}" | ||
|
||
|
||
@BeforeEach | ||
fun `init object mapper`() { | ||
KotlinJacksonDataFormatConfigurator().configure(serverDataFormat) | ||
} | ||
|
||
|
||
@Test | ||
fun `should serialize to JSON and deserialize back`() { | ||
val objectMapper = serverDataFormat.objectMapper | ||
val json = objectMapper.writeValueAsString(order) | ||
assertThat(json).isEqualTo(expectedJson) | ||
val back = objectMapper.readValue<Order>(json) | ||
assertThat(back).isEqualTo(order) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
...ternal-client/src/main/kotlin/infrastructure/KotlinJacksonDataFormatClientConfigurator.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...a-7-external-client/src/main/kotlin/infrastructure/KotlinJacksonDataFormatConfigurator.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.