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.example.loanbroker.esn;
8   
9   import org.mule.api.service.Service;
10  import org.mule.example.loanbroker.tests.AbstractLoanBrokerTestCase;
11  import org.mule.model.seda.SedaModel;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertNotNull;
16  import static org.junit.Assert.assertTrue;
17  
18  public class VMLoanBrokerSynchronousFunctionalTestCase extends AbstractLoanBrokerTestCase
19  {
20  
21      @Override
22      protected String getConfigResources()
23      {
24          return "loan-broker-sync-config.xml, loan-broker-vm-endpoints-config.xml";
25      }
26  
27      @Override
28      protected int getNumberOfRequests()
29      {
30          return 1000;
31      }
32  
33      @Test
34      public void testBasicParsing()
35      {
36          Object objModel = muleContext.getRegistry().lookupModel("loan-broker");
37          assertNotNull(objModel);
38          assertTrue(objModel instanceof SedaModel);
39          SedaModel model = (SedaModel)objModel;
40          assertComponent(model, "TheLoanBroker");
41          assertComponent(model, "TheCreditAgencyService");
42          assertComponent(model, "TheLenderService");
43          assertComponent(model, "TheBankGateway");
44      }
45  
46      protected void assertComponent(SedaModel model, String name)
47      {
48          Service service = muleContext.getRegistry().lookupService(name);
49          assertNotNull(name + " missing", service);
50      }
51  
52  }