Skip to content

Commit

Permalink
fixed HttpRequestActorTest
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Jul 12, 2022
1 parent 53a90e9 commit 10e4fe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
import akka.http.javadsl.model.StatusCode;
import akka.http.javadsl.model.StatusCodes;
import akka.http.javadsl.model.headers.RawHeader;
import akka.testkit.TestProbe;
import akka.util.ByteString;

/**
Expand All @@ -82,15 +81,13 @@ public abstract class AbstractHttpRequestActorTest {
MessageHeaderDefinition.values());

protected static GatewayConfig gatewayConfig;
protected static TestProbe connectivityShardRegionProxy;

@Rule
public final TestNameCorrelationId testNameCorrelationId = TestNameCorrelationId.newInstance();

@BeforeClass
public static void beforeClass() {
gatewayConfig = DittoGatewayConfig.of(DefaultScopedConfig.dittoScoped(ConfigFactory.load("test.conf")));
connectivityShardRegionProxy = ACTOR_SYSTEM_RESOURCE.newTestProbe();
}

void testThingModifyCommand(final ThingId thingId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public void liveCommandWithoutAckRequestWithInvalidResponseTimesOut()
commandHandler.expectNoMessage();

// Assert expected log entry for invalid response.
final var addConnectionLogEntry = connectivityShardRegionProxy.expectMsgClass(SudoAddConnectionLogEntry.class);
final var addConnectionLogEntry = proxyActorTestProbe.expectMsgClass(SudoAddConnectionLogEntry.class);
softly.assertThat((Object) addConnectionLogEntry.getEntityId()).as("connection ID").isEqualTo(connectionId);
softly.assertThat(addConnectionLogEntry.getLogEntry())
.as("log entry")
Expand Down Expand Up @@ -546,7 +546,7 @@ public void liveCommandWithInvalidResponseWithoutConnectionIdIsLoggedOnly()
);

commandHandler.expectNoMessage();
connectivityShardRegionProxy.expectNoMessage();
proxyActorTestProbe.expectNoMessage();

final var futureCompletionTimeout = httpConfig.getRequestTimeout().plusSeconds(1L);
final var httpResponse = httpResponseFuture.get(futureCompletionTimeout.toMillis(), TimeUnit.MILLISECONDS);
Expand Down Expand Up @@ -599,7 +599,7 @@ public void liveCommandWithoutAckRequestWithEventualValidResponseSucceeds()
commandHandler.expectNoMessage();

// Assert expected log entry for invalid response.
final var addConnectionLogEntry = connectivityShardRegionProxy.expectMsgClass(SudoAddConnectionLogEntry.class);
final var addConnectionLogEntry = proxyActorTestProbe.expectMsgClass(SudoAddConnectionLogEntry.class);
softly.assertThat((Object) addConnectionLogEntry.getEntityId()).as("connection ID").isEqualTo(connectionId);
softly.assertThat(addConnectionLogEntry.getLogEntry())
.as("log entry")
Expand Down

0 comments on commit 10e4fe5

Please sign in to comment.