当前位置: 首页>>代码示例>>Java>>正文


Java NotificationMessagingTemplate类代码示例

本文整理汇总了Java中org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate的典型用法代码示例。如果您正苦于以下问题:Java NotificationMessagingTemplate类的具体用法?Java NotificationMessagingTemplate怎么用?Java NotificationMessagingTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NotificationMessagingTemplate类属于org.springframework.cloud.aws.messaging.core包,在下文中一共展示了NotificationMessagingTemplate类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseInternal_withMinimalConfig_shouldCreateDefaultTemplate

import org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate; //导入依赖的package包/类
@Test
public void parseInternal_withMinimalConfig_shouldCreateDefaultTemplate() throws Exception {
    //Arrange
    DefaultListableBeanFactory registry = new DefaultListableBeanFactory();
    XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(registry);

    //Act
    reader.loadBeanDefinitions(new ClassPathResource(getClass().getSimpleName() + "-minimal.xml", getClass()));

    //Assert
    NotificationMessagingTemplate notificationMessagingTemplate = registry.getBean(NotificationMessagingTemplate.class);
    assertSame(registry.getBean(AmazonSNSClient.class), ReflectionTestUtils.getField(notificationMessagingTemplate, "amazonSns"));

    Object cachingDestinationResolverProxy = ReflectionTestUtils.getField(notificationMessagingTemplate, "destinationResolver");
    Object targetDestinationResolver = ReflectionTestUtils.getField(cachingDestinationResolverProxy, "targetDestinationResolver");
    assertEquals(registry.getBean(GlobalBeanDefinitionUtils.RESOURCE_ID_RESOLVER_BEAN_NAME), ReflectionTestUtils.getField(targetDestinationResolver, "resourceIdResolver"));

    assertTrue(CompositeMessageConverter.class.isInstance(notificationMessagingTemplate.getMessageConverter()));
    @SuppressWarnings("unchecked")
    List<MessageConverter> messageConverters = (List<MessageConverter>) ReflectionTestUtils.getField(notificationMessagingTemplate.getMessageConverter(), "converters");
    assertEquals(2, messageConverters.size());
    assertTrue(StringMessageConverter.class.isInstance(messageConverters.get(0)));
    assertTrue(MappingJackson2MessageConverter.class.isInstance(messageConverters.get(1)));

    StringMessageConverter stringMessageConverter = (StringMessageConverter) messageConverters.get(0);
    assertSame(String.class, stringMessageConverter.getSerializedPayloadClass());
    assertEquals(false, ReflectionTestUtils.getField(stringMessageConverter, "strictContentTypeMatch"));

    MappingJackson2MessageConverter jackson2MessageConverter = (MappingJackson2MessageConverter) messageConverters.get(1);
    assertSame(String.class, jackson2MessageConverter.getSerializedPayloadClass());
    assertEquals(false, ReflectionTestUtils.getField(jackson2MessageConverter, "strictContentTypeMatch"));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-aws,代码行数:33,代码来源:NotificationMessagingTemplateBeanDefinitionParserTest.java

示例2: EchoFunctionDelegate

import org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate; //导入依赖的package包/类
@Autowired
public EchoFunctionDelegate(AmazonSNS amazonSns) {
    notificationMessagingTemplate = new NotificationMessagingTemplate(amazonSns);
}
 
开发者ID:holisticon,项目名称:holunda,代码行数:5,代码来源:EchoFunctionDelegate.java

示例3: SnsController

import org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate; //导入依赖的package包/类
@Autowired
public SnsController(NotificationMessagingTemplate notificationMessagingTemplate) {
    this.notificationMessagingTemplate = notificationMessagingTemplate;
}
 
开发者ID:alainsahli,项目名称:spring-cloud-aws-reference-app,代码行数:5,代码来源:SnsController.java

示例4: getBeanClass

import org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate; //导入依赖的package包/类
@Override
protected Class<?> getBeanClass(Element element) {
    return NotificationMessagingTemplate.class;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-aws,代码行数:5,代码来源:NotificationMessagingTemplateBeanDefinitionParser.java

示例5: notificationMessagingTemplate

import org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate; //导入依赖的package包/类
@Bean
public NotificationMessagingTemplate notificationMessagingTemplate(AmazonSNS amazonSNS, ResourceIdResolver resourceIdResolver) {
    return new NotificationMessagingTemplate(amazonSNS, resourceIdResolver);
}
 
开发者ID:spring-cloud-samples,项目名称:aws-refapp,代码行数:5,代码来源:ReferenceApplication.java


注:本文中的org.springframework.cloud.aws.messaging.core.NotificationMessagingTemplate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。