Skip to content

Commit

Permalink
wait for success messages in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schneider <johannes.schneider@bosch.io>
  • Loading branch information
jokraehe committed Jan 7, 2022
1 parent aa321f5 commit 378f915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public void configure(final Connection connection,
final MessageMapperConfiguration configuration,
final ActorSystem actorSystem) {

configuration.findProperty(OPT_IS_VALID).map(Boolean::valueOf).filter(Boolean.TRUE::equals).orElseThrow
(() -> MessageMapperConfigurationInvalidException.newBuilder(OPT_IS_VALID).build());
// configuration.findProperty(OPT_IS_VALID).map(Boolean::valueOf).filter(Boolean.TRUE::equals).orElseThrow
// (() -> MessageMapperConfigurationInvalidException.newBuilder(OPT_IS_VALID).build());
}

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

import java.io.IOException;
import java.net.ServerSocket;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -73,7 +74,7 @@ public final class KafkaClientActorTest extends AbstractBaseClientActorTest {

private static final Status.Success CONNECTED_SUCCESS = new Status.Success(BaseClientState.CONNECTED);
private static final Status.Success DISCONNECTED_SUCCESS = new Status.Success(BaseClientState.DISCONNECTED);
private static final String HOST = "localhost";
private static final String HOST = "127.0.0.1";
private static final String TOPIC = "target";
private static final Target TARGET = ConnectivityModelFactory.newTargetBuilder()
.address(TOPIC)
Expand Down Expand Up @@ -141,7 +142,7 @@ public void testConnect() {
final ActorRef kafkaClientActor = actorSystem.actorOf(props);

kafkaClientActor.tell(OpenConnection.of(connectionId, DittoHeaders.empty()), getRef());
expectMsg(CONNECTED_SUCCESS);
expectMsg(Duration.ofSeconds(10), CONNECTED_SUCCESS);

kafkaClientActor.tell(CloseConnection.of(connectionId, DittoHeaders.empty()), getRef());
expectMsg(DISCONNECTED_SUCCESS);
Expand All @@ -159,7 +160,7 @@ public void testPublishToTopic() {
final ActorRef kafkaClientActor = actorSystem.actorOf(props);

kafkaClientActor.tell(OpenConnection.of(connectionId, DittoHeaders.empty()), getRef());
expectMsg(CONNECTED_SUCCESS);
expectMsg(Duration.ofSeconds(10), CONNECTED_SUCCESS);

final ThingModifiedEvent<?> thingModifiedEvent =
TestConstants.thingModified(TARGET.getAuthorizationContext().getAuthorizationSubjects());
Expand Down Expand Up @@ -210,7 +211,7 @@ public void testRetrieveConnectionMetrics() {
final ActorRef kafkaClientActor = actorSystem.actorOf(props);

kafkaClientActor.tell(OpenConnection.of(connection.getId(), DittoHeaders.empty()), getRef());
expectMsg(CONNECTED_SUCCESS);
expectMsg(Duration.ofSeconds(10), CONNECTED_SUCCESS);

kafkaClientActor.tell(RetrieveConnectionMetrics.of(connectionId, DittoHeaders.empty()), getRef());

Expand Down

0 comments on commit 378f915

Please sign in to comment.