File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
main/java/io/awspring/cloud/sqs/operations
test/java/io/awspring/cloud/sqs/operations Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class BatchingSqsClientAdapter implements SqsAsyncClient {
11
11
private final SqsAsyncBatchManager batchManager ;
12
12
13
13
public BatchingSqsClientAdapter (SqsAsyncBatchManager batchManager ) {
14
+ Assert .notNull (batchManager , "batchManager cannot be null" );
14
15
this .batchManager = batchManager ;
15
16
}
16
17
Original file line number Diff line number Diff line change 29
29
import java .util .function .Consumer ;
30
30
31
31
import static org .assertj .core .api .Assertions .assertThat ;
32
+ import static org .assertj .core .api .Assertions .assertThatThrownBy ;
32
33
import static org .mockito .ArgumentMatchers .any ;
33
34
import static org .mockito .BDDMockito .given ;
34
35
import static org .mockito .BDDMockito .then ;
@@ -49,6 +50,13 @@ void beforeEach() {
49
50
mockAdapter = new BatchingSqsClientAdapter (mockBatchManager );
50
51
}
51
52
53
+ @ Test
54
+ void shouldThrowExceptionWhenBatchManagerIsNull () {
55
+ assertThatThrownBy (() -> new BatchingSqsClientAdapter (null ))
56
+ .isInstanceOf (IllegalArgumentException .class )
57
+ .hasMessage ("batchManager cannot be null" );
58
+ }
59
+
52
60
@ Test
53
61
void shouldReturnCorrectServiceName () {
54
62
String serviceName = mockAdapter .serviceName ();
You can’t perform that action at this time.
0 commit comments