### Question:
AmazonSnsPushMessageSender implements PushMessageSender { @Override public PushMessageSendingResult send(final PushMessage message) { Assert.notNull(message, "Null was passed as an argument for parameter 'message'."); final SendPushNotificationRequestMessageInformation messageInformation = new SendPushNotificationRequestMessageInformation( message.subject(), message.body(), message.properties(), message.platformType() ); return PushMessageSendingResult.of(amazonSnsApiCommunicator .sendPushNotification(messageInformation, message.destinationRouteToken() ) .getMessageId() ); } AmazonSnsPushMessageSender(final AmazonSnsApiCommunicator amazonSnsApiCommunicator); @Override PushMessageSendingResult send(final PushMessage message);  }### Answer:
@Test public void testSendWithInvalidArguments() { Assertions.assertThatThrownBy(() -> pushMessageSender.send(null)) .isInstanceOf(IllegalArgumentException.class); }
@Test public void testSend() { final PushMessage message = PushMessage.of( uuid(), uuid(), uuid(), PlatformType.APNS, Collections.singletonMap(uuid(), uuid())); final String messageId = uuid(); when(amazonSnsApiCommunicator.sendPushNotification(isA(SendPushNotificationRequestMessageInformation.class),eq(message.destinationRouteToken()))).then(invocation -> { assertThat((SendPushNotificationRequestMessageInformation)invocation.getArgument(0)) .hasFieldOrPropertyWithValue("messageSubject",message.subject()) .hasFieldOrPropertyWithValue("messageBody",message.body()) .hasFieldOrPropertyWithValue("messageProperties",message.properties()) .hasFieldOrPropertyWithValue("amazonSNSPlatformType",message.platformType()); assertThat((String)invocation.getArgument(1)).isEqualTo(message.destinationRouteToken()); return new SendPushNotificationResponse(messageId); }); assertThat( pushMessageSender.send(message).messageId()).isEqualTo(messageId); verify(amazonSnsApiCommunicator).sendPushNotification(isA(SendPushNotificationRequestMessageInformation.class),eq(message.destinationRouteToken())); }