Skip to content

Commit

Permalink
Fix test case
Browse files Browse the repository at this point in the history
Signed-off-by: Gagan Juneja <[email protected]>
  • Loading branch information
Gagan Juneja committed Sep 8, 2023
1 parent 518b39f commit a133722
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import org.opensearch.Version;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.network.NetworkAddress;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.transport.TransportAddress;
Expand Down Expand Up @@ -58,15 +57,6 @@ public void testRestRequestContextForNull() {
assertEquals(Attributes.EMPTY, context.getAttributes());
}

public void testTransportContext() {
String action = "test-action";
Transport.Connection connection = createTransportConnection();
SpanCreationContext context = SpanBuilder.from(action, connection);
Attributes attributes = context.getAttributes();
assertEquals(action + " " + NetworkAddress.format(TransportAddress.META_ADDRESS), context.getSpanName());
assertEquals(connection.getNode().getHostAddress(), attributes.getAttributesMap().get(AttributeNames.TRANSPORT_TARGET_HOST));
}

private static Transport.Connection createTransportConnection() {
return new Transport.Connection() {
@Override
Expand Down

0 comments on commit a133722

Please sign in to comment.