|
| 1 | +/* |
| 2 | + * Copyright 2023 Amazon.com, Inc. or its affiliates. |
| 3 | + * Licensed under the Apache License, Version 2.0 (the |
| 4 | + * "License"); you may not use this file except in compliance |
| 5 | + * with the License. You may obtain a copy of the License at |
| 6 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + * Unless required by applicable law or agreed to in writing, software |
| 8 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | + * See the License for the specific language governing permissions and |
| 11 | + * limitations under the License. |
| 12 | + * |
| 13 | + */ |
| 14 | + |
1 | 15 | package software.amazon.lambda.powertools.largemessages.internal;
|
2 | 16 |
|
| 17 | +import static java.lang.String.format; |
| 18 | +import static org.assertj.core.api.Assertions.assertThat; |
| 19 | +import static org.assertj.core.api.Assertions.assertThatThrownBy; |
| 20 | +import static org.mockito.ArgumentMatchers.any; |
| 21 | +import static org.mockito.Mockito.never; |
| 22 | +import static org.mockito.Mockito.verify; |
| 23 | +import static org.mockito.Mockito.verifyNoInteractions; |
| 24 | +import static org.mockito.Mockito.when; |
| 25 | +import static org.mockito.MockitoAnnotations.openMocks; |
| 26 | +import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageAttributesMd5; |
| 27 | +import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageBodyMd5; |
| 28 | + |
3 | 29 | import com.amazonaws.services.lambda.runtime.Context;
|
4 | 30 | import com.amazonaws.services.lambda.runtime.events.KinesisEvent.KinesisEventRecord;
|
5 | 31 | import com.amazonaws.services.lambda.runtime.events.SNSEvent;
|
6 | 32 | import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNS;
|
7 | 33 | import com.amazonaws.services.lambda.runtime.events.SNSEvent.SNSRecord;
|
8 | 34 | import com.amazonaws.services.lambda.runtime.events.SQSEvent.MessageAttribute;
|
9 | 35 | import com.amazonaws.services.lambda.runtime.events.SQSEvent.SQSMessage;
|
| 36 | +import java.io.ByteArrayInputStream; |
| 37 | +import java.lang.reflect.Field; |
| 38 | +import java.nio.ByteBuffer; |
| 39 | +import java.nio.charset.StandardCharsets; |
| 40 | +import java.util.Collections; |
| 41 | +import java.util.HashMap; |
| 42 | +import java.util.Map; |
| 43 | +import java.util.function.Consumer; |
10 | 44 | import org.assertj.core.api.Assertions;
|
11 | 45 | import org.junit.jupiter.api.BeforeEach;
|
12 | 46 | import org.junit.jupiter.api.Test;
|
|
23 | 57 | import software.amazon.lambda.powertools.largemessages.LargeMessageConfig;
|
24 | 58 | import software.amazon.lambda.powertools.largemessages.LargeMessageProcessingException;
|
25 | 59 |
|
26 |
| -import java.io.ByteArrayInputStream; |
27 |
| -import java.lang.reflect.Field; |
28 |
| -import java.nio.ByteBuffer; |
29 |
| -import java.nio.charset.StandardCharsets; |
30 |
| -import java.util.Collections; |
31 |
| -import java.util.HashMap; |
32 |
| -import java.util.Map; |
33 |
| -import java.util.function.Consumer; |
34 |
| - |
35 |
| -import static java.lang.String.format; |
36 |
| -import static org.assertj.core.api.Assertions.assertThat; |
37 |
| -import static org.assertj.core.api.Assertions.assertThatThrownBy; |
38 |
| -import static org.mockito.ArgumentMatchers.any; |
39 |
| -import static org.mockito.Mockito.never; |
40 |
| -import static org.mockito.Mockito.verify; |
41 |
| -import static org.mockito.Mockito.verifyNoInteractions; |
42 |
| -import static org.mockito.Mockito.when; |
43 |
| -import static org.mockito.MockitoAnnotations.openMocks; |
44 |
| -import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageAttributesMd5; |
45 |
| -import static software.amazon.lambda.powertools.largemessages.internal.LargeSQSMessageProcessor.calculateMessageBodyMd5; |
46 |
| - |
47 | 60 | public class LargeMessageAspectTest {
|
48 | 61 |
|
49 | 62 | private static final String BIG_MSG = "A biiiiiiiig message";
|
|
0 commit comments