Skip to content

Commit

Permalink
fix(document-handling): fixes after Simon comment (#3811)
Browse files Browse the repository at this point in the history
* fix(document-handling): fixes after Simon comment

* fix(document-handling): fixes after Simon comment 2
  • Loading branch information
mathias-vandaele authored Dec 16, 2024
1 parent b10324a commit 0efd81c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ public class InboundConnectorContextBuilder {
protected DocumentFactory documentFactory =
new DocumentFactoryImpl(InMemoryDocumentStore.INSTANCE);
protected ObjectMapper objectMapper =
ConnectorsObjectMapperSupplier.getCopy()
.registerModule(
new JacksonModuleDocument(
this.documentFactory,
null,
JacksonModuleDocument.DocumentModuleSettings.create()));
ConnectorsObjectMapperSupplier.getCopy(
this.documentFactory, JacksonModuleDocument.DocumentModuleSettings.create());

public static InboundConnectorContextBuilder create() {
return new InboundConnectorContextBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@ public class OutboundConnectorContextBuilder {
protected DocumentFactory documentFactory =
new DocumentFactoryImpl(InMemoryDocumentStore.INSTANCE);
private ObjectMapper objectMapper =
ConnectorsObjectMapperSupplier.getCopy()
.registerModule(
new JacksonModuleDocument(
this.documentFactory,
null,
JacksonModuleDocument.DocumentModuleSettings.create()));
ConnectorsObjectMapperSupplier.getCopy(
this.documentFactory, JacksonModuleDocument.DocumentModuleSettings.create());

/**
* @return a new instance of the {@link OutboundConnectorContextBuilder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static io.camunda.connector.e2e.BpmnFile.replace;
import static org.mockito.Mockito.when;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
Expand Down Expand Up @@ -64,6 +65,7 @@ public class RabbitMqInboundStartEventTests extends BaseRabbitMqTest {
private static String PORT;
private static RabbitMQContainer rabbitMQContainer;
private static ConnectionFactory factory;
private final ObjectMapper objectMapper = ConnectorsObjectMapperSupplier.getCopy();

@Autowired ProcessStateStore processStateStore;

Expand Down Expand Up @@ -131,10 +133,9 @@ public void uriAuthenticationReceiveMessageTest() throws Exception {

private void assertIntermediateCatchEventUsingModel(BpmnModelInstance model) throws Exception {
Object expectedJsonResponse =
ConnectorsObjectMapperSupplier.getCopy()
.readValue(
"{\"message\":{\"consumerTag\":\"myConsumerTag\",\"body\":{\"foo\": {\"bar\": \"barValue\"}},\"properties\":{}}}",
Object.class);
this.objectMapper.readValue(
"{\"message\":{\"consumerTag\":\"myConsumerTag\",\"body\":{\"foo\": {\"bar\": \"barValue\"}},\"properties\":{}}}",
Object.class);

processStateStore.update(mockProcessDefinition(model));

Expand Down

0 comments on commit 0efd81c

Please sign in to comment.