Search in sources :

Example 1 with SaleInfo

use of org.mule.test.heisenberg.extension.model.SaleInfo in project mule by mulesoft.

the class OperationExecutionTestCase method operationWithMapOfComplexType.

@Test
public void operationWithMapOfComplexType() throws Exception {
    final String dean = "Dean";
    final Map<String, SaleInfo> salesInfo = (Map<String, SaleInfo>) flowRunner("processSale").run().getMessage().getPayload().getValue();
    assertThat(salesInfo, hasKey(dean));
    final SaleInfo saleInfo = salesInfo.get(dean);
    assertThat(saleInfo.getAmount(), is(500));
    assertThat(saleInfo.getDetails(), is("Some detail"));
}
Also used : CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Map(java.util.Map) HashMap(java.util.HashMap) SaleInfo(org.mule.test.heisenberg.extension.model.SaleInfo) Test(org.junit.Test)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Test (org.junit.Test)1 SaleInfo (org.mule.test.heisenberg.extension.model.SaleInfo)1