From b3db5de6b971dd8113a6e3db88e73d61157e2533 Mon Sep 17 00:00:00 2001 From: Mark Farkas <119574841+markfarkas-camunda@users.noreply.github.com> Date: Thu, 27 Apr 2023 11:11:06 +0200 Subject: [PATCH] feat: add propertiesAsType method in InboundConnectorContextBuilder class (#448) --- .../InboundConnectorContextBuilder.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/io/camunda/connector/test/inbound/InboundConnectorContextBuilder.java b/core/src/main/java/io/camunda/connector/test/inbound/InboundConnectorContextBuilder.java index 089a89bc63..7be2e2e2af 100644 --- a/core/src/main/java/io/camunda/connector/test/inbound/InboundConnectorContextBuilder.java +++ b/core/src/main/java/io/camunda/connector/test/inbound/InboundConnectorContextBuilder.java @@ -118,6 +118,17 @@ public InboundConnectorContextBuilder properties(Object obj) { return this; } + /** + * Provides propertiesAsType as object + * + * @param obj - propertiesAsType as object + * @return builder for fluent API + */ + public InboundConnectorContextBuilder propertiesAsType(Object obj) { + this.propertiesAsType = obj; + return this; + } + /** * Assigns correlation result that will be returned on {@link InboundConnectorContext#correlate} * call @@ -144,13 +155,8 @@ public TestInboundConnectorContext build() { } private void assertNoProperties() { - - if (propertiesAsType != null) { - throw new IllegalStateException("propertiesAsType already set"); - } - if (properties != null) { - throw new IllegalStateException("propertiesAsType already set"); + throw new IllegalStateException("properties already set"); } }