Ejemplo n.º 1
0
  @Test
  public void testCreatesProcessManagersAreRemoved() throws Exception {
    OrderMessage message = new OrderPlacedMessage(new Order(123), null);
    factory.handle(message);

    factory.handle(new OrderCompleteMessage(new Order(123), message));

    assertEquals(0, factory.getProcessManagers().size());
  }
Ejemplo n.º 2
0
  @Test
  public void testCreatesDodgyPM() {
    Order dodgyOrder = new Order(123);
    dodgyOrder.setDodgy(true);
    boolean ans = dodgyOrder.getDodgy();

    Order standardOrder = new Order(123);

    OrderPlacedMessage dodgyMessage = new OrderPlacedMessage(dodgyOrder, null);
    factory.handle(dodgyMessage);
    OrderPlacedMessage standardMessage = new OrderPlacedMessage(standardOrder, null);
    factory.handle(standardMessage);
    assertEquals(2, factory.getProcessManagers().size());

    assertEquals(
        StandardProcessManager.class,
        factory.getProcessManagers().get(dodgyMessage.getCorrelationId()).getClass());
    assertEquals(
        PrePayProcessManager.class,
        factory.getProcessManagers().get(standardMessage.getCorrelationId()).getClass());
  }
Ejemplo n.º 3
0
 @Test
 public void testCreatesProcessManagersForOrder() throws Exception {
   factory.handle(new OrderPlacedMessage(new Order(123), null));
   assertEquals(1, factory.getProcessManagers().size());
 }