use of org.springframework.integration.selector.PayloadTypeSelector in project spring-integration by spring-projects.
the class PayloadTypeSelectorTests method testNonAcceptedTypeIsNotSelected.
@Test
public void testNonAcceptedTypeIsNotSelected() {
PayloadTypeSelector selector = new PayloadTypeSelector(Integer.class);
assertFalse(selector.accept(new GenericMessage<String>("test")));
}
use of org.springframework.integration.selector.PayloadTypeSelector in project spring-integration by spring-projects.
the class PayloadTypeSelectorTests method testSuperclassOfAcceptedTypeIsNotSelected.
@Test
public void testSuperclassOfAcceptedTypeIsNotSelected() {
PayloadTypeSelector selector = new PayloadTypeSelector(RuntimeException.class);
assertFalse(selector.accept(new ErrorMessage(new Exception("test"))));
}
use of org.springframework.integration.selector.PayloadTypeSelector in project spring-integration by spring-projects.
the class PayloadTypeSelectorTests method testSubclassOfAcceptedTypeIsSelected.
@Test
public void testSubclassOfAcceptedTypeIsSelected() {
PayloadTypeSelector selector = new PayloadTypeSelector(RuntimeException.class);
assertTrue(selector.accept(new ErrorMessage(new MessagingException("test"))));
}
use of org.springframework.integration.selector.PayloadTypeSelector in project spring-integration by spring-projects.
the class PayloadTypeSelectorTests method testAcceptedTypeIsSelected.
@Test
public void testAcceptedTypeIsSelected() {
PayloadTypeSelector selector = new PayloadTypeSelector(String.class);
assertTrue(selector.accept(new GenericMessage<String>("test")));
}
use of org.springframework.integration.selector.PayloadTypeSelector in project spring-integration by spring-projects.
the class PayloadTypeSelectorTests method testMultipleAcceptedTypes.
@Test
public void testMultipleAcceptedTypes() {
PayloadTypeSelector selector = new PayloadTypeSelector(String.class, Integer.class);
assertTrue(selector.accept(new GenericMessage<String>("test1")));
assertTrue(selector.accept(new GenericMessage<Integer>(2)));
assertFalse(selector.accept(new ErrorMessage(new RuntimeException())));
}
Aggregations