Skip to content

Commit

Permalink
bidirectional > changed openAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian-Limpoeck committed Sep 27, 2024
1 parent 733fad6 commit aec13e5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ public void discoverValues(

private @NotNull CompletableFuture<Void> createAllSubscriptions() {
//noinspection ConstantValue
if (adapterConfig.getOpcuaToMqttConfig().getMappings() == null ||
adapterConfig.getOpcuaToMqttConfig().getMappings().isEmpty()) {
if (adapterConfig.getOpcuaToMqttConfig().getOpcuaToMqttMappings() == null ||
adapterConfig.getOpcuaToMqttConfig().getOpcuaToMqttMappings().isEmpty()) {
return CompletableFuture.completedFuture(null);
}

final CompletableFuture<Void> resultFuture = new CompletableFuture<>();
final ImmutableList.Builder<CompletableFuture<Void>> subscribeFutures = ImmutableList.builder();

for (final OpcUaToMqttMapping subscription : adapterConfig.getOpcuaToMqttConfig().getMappings()) {
for (final OpcUaToMqttMapping subscription : adapterConfig.getOpcuaToMqttConfig().getOpcuaToMqttMappings()) {
subscribeFutures.add(subscribeToNode(subscription));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.hivemq.adapter.sdk.api.annotations.ModuleConfigField;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -37,7 +36,7 @@ public OpcUaToMqttConfig(@JsonProperty("opcuaToMqttMappings") final @Nullable Li
this.opcuaToMqttMappings = Objects.requireNonNullElse(opcuaToMqttMappings, List.of());
}

public @NotNull List<OpcUaToMqttMapping> getMappings() {
public @NotNull List<OpcUaToMqttMapping> getOpcuaToMqttMappings() {
return opcuaToMqttMappings;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void convertConfigObject_fullConfig_valid() throws Exception {
});

assertThat(config.getOpcuaToMqttConfig()).isNotNull();
assertThat(config.getOpcuaToMqttConfig().getMappings()).satisfiesExactly(mapping -> {
assertThat(config.getOpcuaToMqttConfig().getOpcuaToMqttMappings()).satisfiesExactly(mapping -> {
assertThat(mapping.getNode()).isEqualTo("ns=1;i=1004");
assertThat(mapping.getMqttTopic()).isEqualTo("test/blubb/#");
assertThat(mapping.getQos()).isEqualTo(1);
Expand Down Expand Up @@ -127,7 +127,7 @@ public void convertConfigObject_defaults_valid() throws Exception {
});

assertThat(config.getOpcuaToMqttConfig()).isNotNull();
assertThat(config.getOpcuaToMqttConfig().getMappings()).satisfiesExactly(mapping -> {
assertThat(config.getOpcuaToMqttConfig().getOpcuaToMqttMappings()).satisfiesExactly(mapping -> {
assertThat(mapping.getNode()).isEqualTo("ns=1;i=1004");
assertThat(mapping.getMqttTopic()).isEqualTo("test/blubb/#");
assertThat(mapping.getQos()).isEqualTo(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void convertConfigObject_fullConfig_valid() throws Exception {
});

assertThat(config.getOpcuaToMqttConfig()).isNotNull();
assertThat(config.getOpcuaToMqttConfig().getMappings()).satisfiesExactly(mapping -> {
assertThat(config.getOpcuaToMqttConfig().getOpcuaToMqttMappings()).satisfiesExactly(mapping -> {
assertThat(mapping.getNode()).isEqualTo("ns=1;i=1004");
assertThat(mapping.getMqttTopic()).isEqualTo("test/blubb/#");
assertThat(mapping.getQos()).isEqualTo(1);
Expand Down Expand Up @@ -137,7 +137,7 @@ public void convertConfigObject_defaults_valid() throws Exception {
});

assertThat(config.getOpcuaToMqttConfig()).isNotNull();
assertThat(config.getOpcuaToMqttConfig().getMappings()).satisfiesExactly(mapping -> {
assertThat(config.getOpcuaToMqttConfig().getOpcuaToMqttMappings()).satisfiesExactly(mapping -> {
assertThat(mapping.getNode()).isEqualTo("ns=1;i=1004");
assertThat(mapping.getMqttTopic()).isEqualTo("test/blubb/#");
assertThat(mapping.getQos()).isEqualTo(0);
Expand Down

0 comments on commit aec13e5

Please sign in to comment.