|
| 1 | +/* |
| 2 | + * Copyright The Hypertrace Authors |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package org.hypertrace.agent.core.instrumentation; |
| 18 | + |
| 19 | +import org.junit.jupiter.api.Assertions; |
| 20 | +import org.junit.jupiter.api.Test; |
| 21 | + |
| 22 | +public class HypertraceSemanticAttributesTest { |
| 23 | + |
| 24 | + @Test |
| 25 | + public void caseInsensitiveHttpRequestHeader() { |
| 26 | + Assertions.assertEquals( |
| 27 | + "http.request.header.content-type", |
| 28 | + HypertraceSemanticAttributes.httpRequestHeader("Content-Type").getKey()); |
| 29 | + } |
| 30 | + |
| 31 | + @Test |
| 32 | + public void caseInsensitiveHttpResponseHeader() { |
| 33 | + Assertions.assertEquals( |
| 34 | + "http.response.header.content-type", |
| 35 | + HypertraceSemanticAttributes.httpResponseHeader("Content-Type").getKey()); |
| 36 | + } |
| 37 | + |
| 38 | + @Test |
| 39 | + public void caseInsensitiveRpcRequestMetadata() { |
| 40 | + Assertions.assertEquals( |
| 41 | + "rpc.request.metadata.md", HypertraceSemanticAttributes.rpcRequestMetadata("MD").getKey()); |
| 42 | + } |
| 43 | + |
| 44 | + @Test |
| 45 | + public void caseInsensitiveRpcResponseMetadata() { |
| 46 | + Assertions.assertEquals( |
| 47 | + "rpc.response.metadata.md", |
| 48 | + HypertraceSemanticAttributes.rpcResponseMetadata("MD").getKey()); |
| 49 | + } |
| 50 | +} |
0 commit comments