This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 80f0a8b914b9d4e188a5f6be761e82a185d2f169 Author: Andrea Cosentino <[email protected]> AuthorDate: Wed Feb 17 09:22:03 2021 +0100 CAMEL-16115 - Remove Camel-AWS-* components - AWS-SQS - remove remaining refs --- .../messaging/AwsSqsSegmentDecorator.java | 34 ------------------ .../org.apache.camel.tracing.SpanDecorator | 1 - .../org.apache.camel.tracing.SpanDecorator | 1 - .../tracing/decorators/AwsSqsSpanDecorator.java | 40 --------------------- .../decorators/AwsSqsSpanDecoratorTest.java | 42 ---------------------- 5 files changed, 118 deletions(-) diff --git a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java b/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java deleted file mode 100644 index e7bcafe..0000000 --- a/components/camel-aws-xray/src/main/java/org/apache/camel/component/aws/xray/decorators/messaging/AwsSqsSegmentDecorator.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.aws.xray.decorators.messaging; - -import org.apache.camel.Exchange; - -public class AwsSqsSegmentDecorator extends AbstractMessagingSegmentDecorator { - - protected static final String CAMEL_AWS_SQS_MESSAGE_ID = "CamelAwsSqsMessageId"; - - @Override - public String getComponent() { - return "aws-sqs"; - } - - @Override - public String getMessageId(Exchange exchange) { - return (String) exchange.getIn().getHeader(CAMEL_AWS_SQS_MESSAGE_ID); - } -} diff --git a/components/camel-opentelemetry/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator b/components/camel-opentelemetry/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator index 8647a19..e1eb882 100644 --- a/components/camel-opentelemetry/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator +++ b/components/camel-opentelemetry/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator @@ -17,7 +17,6 @@ org.apache.camel.tracing.decorators.AhcSpanDecorator org.apache.camel.tracing.decorators.AmqpSpanDecorator -org.apache.camel.tracing.decorators.AwsSqsSpanDecorator org.apache.camel.tracing.decorators.AwsSnsSpanDecorator org.apache.camel.tracing.decorators.CometdSpanDecorator org.apache.camel.tracing.decorators.CometdsSpanDecorator diff --git a/components/camel-opentracing/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator b/components/camel-opentracing/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator index 8647a19..e1eb882 100644 --- a/components/camel-opentracing/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator +++ b/components/camel-opentracing/src/main/resources/META-INF/services/org.apache.camel.tracing.SpanDecorator @@ -17,7 +17,6 @@ org.apache.camel.tracing.decorators.AhcSpanDecorator org.apache.camel.tracing.decorators.AmqpSpanDecorator -org.apache.camel.tracing.decorators.AwsSqsSpanDecorator org.apache.camel.tracing.decorators.AwsSnsSpanDecorator org.apache.camel.tracing.decorators.CometdSpanDecorator org.apache.camel.tracing.decorators.CometdsSpanDecorator diff --git a/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/AwsSqsSpanDecorator.java b/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/AwsSqsSpanDecorator.java deleted file mode 100644 index 3a9d826..0000000 --- a/components/camel-tracing/src/main/java/org/apache/camel/tracing/decorators/AwsSqsSpanDecorator.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.tracing.decorators; - -import org.apache.camel.Exchange; - -public class AwsSqsSpanDecorator extends AbstractMessagingSpanDecorator { - - public static final String CAMEL_AWS_SQS_MESSAGE_ID = "CamelAwsSqsMessageId"; - - @Override - public String getComponent() { - return "aws-sqs"; - } - - @Override - public String getComponentClassName() { - return "org.apache.camel.component.aws.sqs.SqsComponent"; - } - - @Override - protected String getMessageId(Exchange exchange) { - return (String) exchange.getIn().getHeader(CAMEL_AWS_SQS_MESSAGE_ID); - } - -} diff --git a/components/camel-tracing/src/test/java/org/apache/camel/tracing/decorators/AwsSqsSpanDecoratorTest.java b/components/camel-tracing/src/test/java/org/apache/camel/tracing/decorators/AwsSqsSpanDecoratorTest.java deleted file mode 100644 index 819e097..0000000 --- a/components/camel-tracing/src/test/java/org/apache/camel/tracing/decorators/AwsSqsSpanDecoratorTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.tracing.decorators; - -import org.apache.camel.Exchange; -import org.apache.camel.Message; -import org.junit.jupiter.api.Test; -import org.mockito.Mockito; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -public class AwsSqsSpanDecoratorTest { - - @Test - public void testGetMessageId() { - String messageId = "abcd"; - Exchange exchange = Mockito.mock(Exchange.class); - Message message = Mockito.mock(Message.class); - - Mockito.when(exchange.getIn()).thenReturn(message); - Mockito.when(message.getHeader(AwsSqsSpanDecorator.CAMEL_AWS_SQS_MESSAGE_ID)).thenReturn(messageId); - - AwsSqsSpanDecorator decorator = new AwsSqsSpanDecorator(); - - assertEquals(messageId, decorator.getMessageId(exchange)); - } - -}
