コード例 #1
0
 @Test
 public void testGetRoutingKey_NullValueWithRandomPolicy() throws Exception {
   testSubject = new AnnotationRoutingStrategy(UnresolvedRoutingKeyPolicy.RANDOM_KEY);
   CommandMessage<Object> command = new GenericCommandMessage<Object>(new Object());
   // two calls should provide the same result
   assertFalse(testSubject.getRoutingKey(command).equals(testSubject.getRoutingKey(command)));
 }
コード例 #2
0
 @Test
 public void testGetRoutingKey() throws Exception {
   String actual =
       testSubject.getRoutingKey(
           new GenericCommandMessage<Object>(new StubCommand("SomeIdentifier")));
   assertEquals("SomeIdentifier", actual);
 }
コード例 #3
0
 @Test(expected = CommandDispatchException.class)
 public void testGetRoutingKey_NoKey() throws Exception {
   assertNull(testSubject.getRoutingKey(new GenericCommandMessage<Object>("Just a String")));
 }