@Test void convertAndSend_withPayloadAndSubject_shouldSetSubject() throws Exception { AmazonSNS amazonSns = mock(AmazonSNS.class); NotificationMessagingTemplate notificationMessagingTemplate = new NotificationMessagingTemplate( amazonSns); String physicalTopicName = "arn:aws:sns:eu-west:123456789012:test"; when(amazonSns.listTopics(new ListTopicsRequest(null))) .thenReturn(new ListTopicsResult() .withTopics(new Topic().withTopicArn(physicalTopicName))); notificationMessagingTemplate.setDefaultDestinationName(physicalTopicName); notificationMessagingTemplate.sendNotification("My message", "My subject"); verify(amazonSns) .publish(new PublishRequest(physicalTopicName, "My message", "My subject") .withMessageAttributes(isNotNull())); }
public void sendNotification(String destinationName, Object message, String subject) { this.convertAndSend(destinationName, message, Collections .singletonMap(TopicMessageChannel.NOTIFICATION_SUBJECT_HEADER, subject)); }
NotificationMessagingTemplate extends AbstractMessageChannelMessagingSendingTemplate<TopicMessageChannel> { public void sendNotification(String destinationName, Object message, String subject) { this.convertAndSend(destinationName, message, Collections .singletonMap(TopicMessageChannel.NOTIFICATION_SUBJECT_HEADER, subject)); } }
NotificationMessagingTemplate extends AbstractMessageChannelMessagingSendingTemplate<TopicMessageChannel> { public void sendNotification(String destinationName, Object message, String subject) { this.convertAndSend(destinationName, message, Collections .singletonMap(TopicMessageChannel.NOTIFICATION_SUBJECT_HEADER, subject)); } NotificationMessagingTemplate(AmazonSNS amazonSns);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			ResourceIdResolver resourceIdResolver);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			ResourceIdResolver resourceIdResolver, MessageConverter messageConverter);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			DestinationResolver<String> destinationResolver,
			MessageConverter messageConverter); }
NotificationMessagingTemplate extends AbstractMessageChannelMessagingSendingTemplate<TopicMessageChannel> { public void sendNotification(String destinationName, Object message, String subject) { this.convertAndSend(destinationName, message, Collections .singletonMap(TopicMessageChannel.NOTIFICATION_SUBJECT_HEADER, subject)); } NotificationMessagingTemplate(AmazonSNS amazonSns);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			ResourceIdResolver resourceIdResolver);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			ResourceIdResolver resourceIdResolver, MessageConverter messageConverter);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			DestinationResolver<String> destinationResolver,
			MessageConverter messageConverter); void sendNotification(String destinationName, Object message, String subject); void sendNotification(Object message, String subject); }
NotificationMessagingTemplate extends AbstractMessageChannelMessagingSendingTemplate<TopicMessageChannel> { public void sendNotification(String destinationName, Object message, String subject) { this.convertAndSend(destinationName, message, Collections .singletonMap(TopicMessageChannel.NOTIFICATION_SUBJECT_HEADER, subject)); } NotificationMessagingTemplate(AmazonSNS amazonSns);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			ResourceIdResolver resourceIdResolver);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			ResourceIdResolver resourceIdResolver, MessageConverter messageConverter);  NotificationMessagingTemplate(AmazonSNS amazonSns,
			DestinationResolver<String> destinationResolver,
			MessageConverter messageConverter); void sendNotification(String destinationName, Object message, String subject); void sendNotification(Object message, String subject);  }