View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.config.spring;
8   
9   import org.mule.tck.junit4.FunctionalTestCase;
10  import org.mule.api.MuleException;
11  
12  import static org.junit.Assert.assertEquals;
13  import static org.junit.Assert.assertNotNull;
14  
15  public abstract class AbstractInterceptorTestCase extends FunctionalTestCase
16  {
17  
18      public static final String MESSAGE = "boo";
19  
20      public void assertMessageIntercepted() throws MuleException, InterruptedException
21      {
22          FunctionalTestAdvice advice = (FunctionalTestAdvice) muleContext.getRegistry().lookupObject("advice");
23          assertNotNull("Cannot find advice", advice);
24          String message = advice.getMessage(RECEIVE_TIMEOUT);
25          assertEquals("Bad message", MESSAGE, message);
26      }
27  
28  }