From 690eb4c144a78c0e81906b390af4c8cffad11b1a Mon Sep 17 00:00:00 2001 From: Stanchev Aleksandar Date: Wed, 12 Oct 2022 18:30:42 +0300 Subject: [PATCH] Minor code review fixes Signed-off-by: Stanchev Aleksandar --- java/src/main/java/org/eclipse/ditto/client/live/Live.java | 1 - .../ditto/client/live/internal/LiveFeatureHandleImpl.java | 2 +- .../org/eclipse/ditto/client/live/internal/LiveImpl.java | 2 +- .../ditto/client/live/internal/LiveThingHandleImpl.java | 2 +- .../ditto/client/live/internal/PendingMessageImpl.java | 5 +++-- .../ditto/client/internal/OutgoingMessageFactoryTest.java | 7 +------ 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/java/src/main/java/org/eclipse/ditto/client/live/Live.java b/java/src/main/java/org/eclipse/ditto/client/live/Live.java index 14953306..cd5384ca 100755 --- a/java/src/main/java/org/eclipse/ditto/client/live/Live.java +++ b/java/src/main/java/org/eclipse/ditto/client/live/Live.java @@ -72,7 +72,6 @@ public interface Live extends CommonManagement the type of the Message's payload. * @param options options sent to the outbound message. - * @param options options sent to the outbound message. * @return a new message builder that offers the functionality to create and send the message. * @since 3.1.0 */ diff --git a/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveFeatureHandleImpl.java b/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveFeatureHandleImpl.java index 5fe85ee5..ae13e428 100755 --- a/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveFeatureHandleImpl.java +++ b/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveFeatureHandleImpl.java @@ -93,7 +93,7 @@ public PendingMessageWithFeatureId message() { @Override public PendingMessageWithFeatureId message(final Option... options) { return PendingMessageImpl.of(LOGGER, outgoingMessageFactory, messageSerializerRegistry, PROTOCOL_ADAPTER, - messagingProvider).withThingAndFeatureIds(getEntityId(), getFeatureId()); + messagingProvider, options).withThingAndFeatureIds(getEntityId(), getFeatureId()); } @Override diff --git a/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveImpl.java b/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveImpl.java index 5d8f7965..78d519a6 100644 --- a/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveImpl.java +++ b/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveImpl.java @@ -228,7 +228,7 @@ public PendingMessage message() { @Override public PendingMessage message(final Option... options) { return PendingMessageImpl.of(LOGGER, outgoingMessageFactory, messageSerializerRegistry, PROTOCOL_ADAPTER, - messagingProvider); + messagingProvider, options); } @Override diff --git a/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveThingHandleImpl.java b/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveThingHandleImpl.java index 88848be8..94c59713 100755 --- a/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveThingHandleImpl.java +++ b/java/src/main/java/org/eclipse/ditto/client/live/internal/LiveThingHandleImpl.java @@ -102,7 +102,7 @@ public PendingMessageWithThingId message() { @Override public PendingMessageWithThingId message(final Option... options) { return PendingMessageImpl.of(LOGGER, outgoingMessageFactory, messageSerializerRegistry, PROTOCOL_ADAPTER, - messagingProvider).withThingId(getEntityId()); + messagingProvider, options).withThingId(getEntityId()); } @Override diff --git a/java/src/main/java/org/eclipse/ditto/client/live/internal/PendingMessageImpl.java b/java/src/main/java/org/eclipse/ditto/client/live/internal/PendingMessageImpl.java index e9c1633e..9af67355 100644 --- a/java/src/main/java/org/eclipse/ditto/client/live/internal/PendingMessageImpl.java +++ b/java/src/main/java/org/eclipse/ditto/client/live/internal/PendingMessageImpl.java @@ -64,10 +64,11 @@ static PendingMessageImpl of(final Logger logger, final OutgoingMessageFactory outgoingMessageFactory, final MessageSerializerRegistry messageSerializerRegistry, final ProtocolAdapter protocolAdapter, - final MessagingProvider messagingProvider) { + final MessagingProvider messagingProvider, + final Option... options) { return new PendingMessageImpl<>(logger, outgoingMessageFactory, messageSerializerRegistry, protocolAdapter, - messagingProvider); + messagingProvider, options); } PendingMessageWithThingId withThingId(final ThingId thingId) { diff --git a/java/src/test/java/org/eclipse/ditto/client/internal/OutgoingMessageFactoryTest.java b/java/src/test/java/org/eclipse/ditto/client/internal/OutgoingMessageFactoryTest.java index b957bb2c..5317ff91 100644 --- a/java/src/test/java/org/eclipse/ditto/client/internal/OutgoingMessageFactoryTest.java +++ b/java/src/test/java/org/eclipse/ditto/client/internal/OutgoingMessageFactoryTest.java @@ -19,18 +19,13 @@ import org.assertj.core.api.JUnitSoftAssertions; import org.eclipse.ditto.base.model.headers.DittoHeaderDefinition; import org.eclipse.ditto.base.model.json.JsonSchemaVersion; -import org.eclipse.ditto.client.live.messages.MessageSerializerRegistry; -import org.eclipse.ditto.client.live.messages.MessageSerializers; import org.eclipse.ditto.client.live.messages.internal.DefaultMessageSerializerRegistry; import org.eclipse.ditto.client.options.OptionName; import org.eclipse.ditto.client.options.Options; -import org.eclipse.ditto.json.JsonObject; import org.eclipse.ditto.messages.model.Message; import org.eclipse.ditto.messages.model.MessageDirection; import org.eclipse.ditto.messages.model.MessageHeaders; import org.eclipse.ditto.messages.model.MessagesModelFactory; -import org.eclipse.ditto.messages.model.signals.commands.SendThingMessage; -import org.eclipse.ditto.things.model.ThingId; import org.eclipse.ditto.things.model.signals.commands.query.RetrieveFeature; import org.junit.Before; import org.junit.Rule; @@ -92,7 +87,7 @@ public void deleteThingWithLiveChannelConditionExpressionThrowsException() { } @Test - public void LiveMessageWithOnlyAllowedOptionsReturnsExpected() { + public void liveMessageWithOnlyAllowedOptionsReturnsExpected() { final Message liveMessage = underTest.sendMessage(new DefaultMessageSerializerRegistry(), getMessage(), Options.condition(CONDITION_EXPRESSION));