-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
989 additions
and
288 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
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
39 changes: 39 additions & 0 deletions
39
...son/src/test/kotlin/io/holunda/polyflow/bus/jackson/CreateTaskCommandSerializationTest.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,39 @@ | ||
package io.holunda.polyflow.bus.jackson | ||
|
||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper | ||
import com.fasterxml.jackson.module.kotlin.readValue | ||
import io.holunda.camunda.taskpool.api.task.CreateTaskCommand | ||
import io.holunda.camunda.taskpool.api.task.GenericReference | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.camunda.bpm.engine.variable.Variables | ||
import org.junit.jupiter.api.Test | ||
|
||
internal class CreateTaskCommandSerializationTest { | ||
private val om = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() | ||
|
||
@Test | ||
fun `serialize createTaskCommand from to json`() { | ||
val cmd = CreateTaskCommand( | ||
id = "1", | ||
sourceReference = GenericReference( | ||
"1", | ||
"1", | ||
"def#1", | ||
"def", | ||
"name", | ||
"appName", | ||
"tenant" | ||
), | ||
taskDefinitionKey = "taskKey", | ||
formKey = "form", | ||
businessKey = "123", | ||
payload = Variables.putValueTyped("foo", Variables.stringValue("bar")) | ||
) | ||
|
||
val json = om.writeValueAsString(cmd) | ||
|
||
val deserialized = om.readValue<CreateTaskCommand>(json) | ||
|
||
assertThat(deserialized).isEqualTo(cmd) | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...son/src/test/kotlin/io/holunda/polyflow/bus/jackson/DataEntryCommandsSerializationTest.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,47 @@ | ||
package io.holunda.polyflow.bus.jackson | ||
|
||
import com.fasterxml.jackson.databind.SerializationFeature | ||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule | ||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper | ||
import com.fasterxml.jackson.module.kotlin.readValue | ||
import io.holunda.camunda.taskpool.api.business.* | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.camunda.bpm.engine.variable.Variables | ||
import org.camunda.bpm.engine.variable.Variables.* | ||
import org.junit.jupiter.api.Disabled | ||
import org.junit.jupiter.api.Test | ||
|
||
internal class DataEntryCommandsSerializationTest { | ||
private val om = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() | ||
.registerModule(JavaTimeModule()) | ||
.apply { | ||
configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) | ||
} | ||
|
||
@Test | ||
@Disabled("fails comparing payload and modification") | ||
fun `serialize createDataEntryCommand`() { | ||
val cmd = CreateDataEntryCommand( | ||
dataEntryChange = DataEntryChange( | ||
entryType = "order", | ||
entryId = "12345", | ||
type = "purchase order", | ||
applicationName = "someApp", | ||
name = "Order 12345", | ||
correlations = newCorrelations().putValueTyped("foo", stringValue("bar")), | ||
payload = Variables.createVariables() | ||
.putValue("long",17L) | ||
.putValue("boolean", true), | ||
description = "some text", | ||
state = ProcessingType.IN_PROGRESS.of("created"), | ||
modification = Modification.NONE | ||
) | ||
) | ||
val json = om.writeValueAsString(cmd) | ||
val deserialized = om.readValue<CreateDataEntryCommand>(json) | ||
|
||
assertThat(deserialized) | ||
.usingRecursiveComparison() | ||
.isEqualTo(cmd) | ||
} | ||
} |
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
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
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 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
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
Oops, something went wrong.