Skip to content

Commit

Permalink
Merge remote-tracking branch 'ce/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-babak committed Dec 13, 2023
2 parents ff14311 + f476151 commit baf5921
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
2 changes: 2 additions & 0 deletions application/src/main/data/upgrade/3.6.1/schema_update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ ALTER TABLE resource ADD COLUMN IF NOT EXISTS external_id uuid;
CREATE INDEX IF NOT EXISTS idx_resource_etag ON resource(tenant_id, etag);

-- RESOURCES UPDATE END

CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_edge_id_created_time ON edge_event(tenant_id, edge_id, created_time DESC);
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
@Data
public class CoapTestCallback implements CoapHandler {

protected Integer observe;
protected byte[] payloadBytes;
protected CoAP.ResponseCode responseCode;
protected volatile Integer observe;
protected volatile byte[] payloadBytes;
protected volatile CoAP.ResponseCode responseCode;

public Integer getObserve() {
return observe;
Expand Down
4 changes: 3 additions & 1 deletion dao/src/main/resources/sql/schema-entities-idx.sql
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ CREATE INDEX IF NOT EXISTS idx_audit_log_id ON audit_log(id);

CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_and_created_time ON edge_event(tenant_id, created_time DESC);

CREATE INDEX IF NOT EXISTS idx_cloud_event_tenant_id_and_created_time ON cloud_event(tenant_id, created_time DESC);
CREATE INDEX IF NOT EXISTS idx_edge_event_tenant_id_edge_id_created_time ON edge_event(tenant_id, edge_id, created_time DESC);

CREATE INDEX IF NOT EXISTS idx_edge_event_id ON edge_event(id);

CREATE INDEX IF NOT EXISTS idx_cloud_event_tenant_id_and_created_time ON cloud_event(tenant_id, created_time DESC);

CREATE INDEX IF NOT EXISTS idx_rpc_tenant_id_device_id ON rpc(tenant_id, device_id);

CREATE INDEX IF NOT EXISTS idx_device_external_id ON device(tenant_id, external_id);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<cassandra-all.version>3.11.14</cassandra-all.version>
<guava.version>31.1-jre</guava.version>
<caffeine.version>2.6.1</caffeine.version>
<commons-lang3.version>3.4</commons-lang3.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-codec.version>1.15</commons-codec.version>
<commons-io.version>2.11.0</commons-io.version>
<commons-logging.version>1.2</commons-logging.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
Expand All @@ -41,6 +40,7 @@
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import static org.assertj.core.api.Assertions.assertThatThrownBy;
Expand Down Expand Up @@ -169,21 +169,20 @@ public void testProcessMessageWithJsonInUrlVariable() throws Exception {
capturedData.capture()
)).thenReturn(successMsg);

CountDownLatch latch = new CountDownLatch(1);

httpClient.processMessage(ctx, msg,
m -> ctx.tellSuccess(msg),
ctx::tellFailure);

Awaitility.await()
.atMost(30, TimeUnit.SECONDS)
.until(() -> {
try {
verify(ctx, times(1)).tellSuccess(any());
return true;
} catch (Exception e) {
return false;
}
m -> {
ctx.tellSuccess(msg);
latch.countDown();
},
(m, t) -> {
ctx.tellFailure(m, t);
latch.countDown();
});

latch.await(5, TimeUnit.SECONDS);

verify(ctx, times(1)).tellSuccess(any());
verify(ctx, times(0)).tellFailure(any(), any());
Assertions.assertEquals(successResponseBody, capturedData.getValue());
Expand Down

0 comments on commit baf5921

Please sign in to comment.