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.transaction;
8   
9   import org.mule.api.MuleEvent;
10  import org.mule.tck.junit4.AbstractMuleTestCase;
11  import org.mule.transaction.constraints.ConstraintFilter;
12  
13  import org.junit.Test;
14  import org.mockito.Mockito;
15  
16  import static org.junit.Assert.assertNotNull;
17  import static org.junit.Assert.assertNotSame;
18  import static org.junit.Assert.assertTrue;
19  
20  public class TransactionConstraintTestCase extends AbstractMuleTestCase
21  {
22      @Test
23      public void testConstraintFilter() throws Exception
24      {
25          ConstraintFilter filter = new ConstraintFilter();
26          MuleEvent event = Mockito.mock(MuleEvent.class);
27          assertTrue(filter.accept(event));
28  
29          ConstraintFilter clone = (ConstraintFilter)filter.clone();
30          assertNotNull(clone);
31          assertNotSame(filter, clone);
32      }
33  }