View Javadoc

1   /*
2    * $Id: TransactionConstraintTestCase.java 22377 2011-07-11 12:41:42Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transaction;
12  
13  import org.mule.api.MuleEvent;
14  import org.mule.tck.junit4.AbstractMuleTestCase;
15  import org.mule.transaction.constraints.ConstraintFilter;
16  
17  import org.junit.Test;
18  import org.mockito.Mockito;
19  
20  import static org.junit.Assert.assertNotNull;
21  import static org.junit.Assert.assertNotSame;
22  import static org.junit.Assert.assertTrue;
23  
24  public class TransactionConstraintTestCase extends AbstractMuleTestCase
25  {
26      @Test
27      public void testConstraintFilter() throws Exception
28      {
29          ConstraintFilter filter = new ConstraintFilter();
30          MuleEvent event = Mockito.mock(MuleEvent.class);
31          assertTrue(filter.accept(event));
32  
33          ConstraintFilter clone = (ConstraintFilter)filter.clone();
34          assertNotNull(clone);
35          assertNotSame(filter, clone);
36      }
37  }