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.module.ibeans.annotations;
8   
9   import org.ibeans.annotation.IntegrationBean;
10  import org.ibeans.api.CallException;
11  import org.junit.Test;
12  
13  import static org.junit.Assert.fail;
14  
15  public class ImplicitPropertiesInFactoryTestCase extends AbstractIBeansTestCase
16  {
17      @SuppressWarnings("unused")
18      @IntegrationBean
19      private TestImplicitPropertiesinFactoryIBean testIBean;
20  
21      @Test
22      public void testGetHttpMethod() throws Exception
23      {
24          try
25          {
26              testIBean.doStuff();
27              fail("Should have failed since the call cannot be made");
28          }
29          catch (CallException e)
30          {
31              //expected, we can't actually connect to the service
32          }
33          catch (IllegalArgumentException e)
34          {
35              fail("It seems the HTTP method property was not set implicitly: " + e.getMessage());
36          }
37      }
38  
39  }