Skip to content

Commit 6d94b38

Browse files
committed
Fix tests
1 parent 3599876 commit 6d94b38

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

src/test/java/com/timgroup/statsd/NonBlockingStatsDClientTest.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,13 @@ public void sends_gauge_entityID_from_env_deprecated() throws Exception {
714714
.hostname("localhost")
715715
.port(STATSD_SERVER_PORT)
716716
.queueSize(Integer.MAX_VALUE)
717+
.containerID("fake-container-id")
717718
.build();
718719
try {
719720
client.gauge("value", 423);
720721
server.waitForMessage("my.prefix");
721722

722-
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity")));
723+
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity|c:fake-container-id")));
723724
} finally {
724725
client.stop();
725726
}
@@ -734,12 +735,13 @@ public void sends_gauge_entityID_from_env() throws Exception {
734735
.hostname("localhost")
735736
.port(STATSD_SERVER_PORT)
736737
.queueSize(Integer.MAX_VALUE)
738+
.containerID("fake-container-id")
737739
.build();
738740
try {
739741
client.gauge("value", 423);
740742
server.waitForMessage();
741743

742-
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity")));
744+
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity|c:fake-container-id")));
743745
} finally {
744746
client.stop();
745747
}
@@ -756,12 +758,13 @@ public void sends_gauge_entityID_from_env_and_constant_tags_deprecated() throws
756758
.port(STATSD_SERVER_PORT)
757759
.queueSize(Integer.MAX_VALUE)
758760
.constantTags(constantTags)
761+
.containerID("fake-container-id")
759762
.build();
760763
try {
761764
client.gauge("value", 423);
762765
server.waitForMessage("my.prefix");
763766

764-
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity," + constantTags)));
767+
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity," + constantTags + "|c:fake-container-id")));
765768
} finally {
766769
client.stop();
767770
}
@@ -802,13 +805,14 @@ public void sends_gauge_entityID_from_args_deprecated() throws Exception {
802805
.constantTags(null)
803806
.errorHandler(null)
804807
.entityID(entity_value+"-arg")
808+
.containerID("fake-container-id")
805809
.build();
806810

807811
try {
808812
client.gauge("value", 423);
809813
server.waitForMessage("my.prefix");
810814

811-
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity-arg")));
815+
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity-arg|c:fake-container-id")));
812816
} finally {
813817
client.stop();
814818
}
@@ -824,12 +828,13 @@ public void sends_gauge_entityID_from_args() throws Exception {
824828
.port(STATSD_SERVER_PORT)
825829
.queueSize(Integer.MAX_VALUE)
826830
.entityID(entity_value+"-arg")
831+
.containerID("fake-container-id")
827832
.build();
828833
try {
829834
client.gauge("value", 423);
830835
server.waitForMessage("my.prefix");
831836

832-
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity-arg")));
837+
assertThat(server.messagesReceived(), hasItem(comparesEqualTo("my.prefix.value:423|g|#dd.internal.entity_id:foo-entity-arg|c:fake-container-id")));
833838
} finally {
834839
client.stop();
835840
}

0 commit comments

Comments
 (0)