// no mappings added
assertNotNull(config.getMappings());
assertEquals(2, config.getMappings().size());
// validate mapping properties for mappingA
UrlMapping mappingA = config.getMappingById("mappingA");
assertNotNull(mappingA);
assertEquals("mappingA", mappingA.getId());
assertEquals("/some/url/a", mappingA.getPattern());
assertEquals("/view.jsf", mappingA.getViewId());
assertEquals(true, mappingA.isOutbound());
assertEquals(true, mappingA.isOnPostback());
assertEquals(1, mappingA.getActions().size());
assertEquals(2, mappingA.getQueryParams().size());
assertEquals(0, mappingA.getPathValidators().size());
assertEquals("#{multiMappingBean.actionForBoth}",
mappingA.getActions().get(0).getAction().getELExpression());
// we don't know the order in which the query parameters are added
List<String> queryParamExpressionsA = Arrays.asList(
mappingA.getQueryParams().get(0).getExpression().getELExpression(),
mappingA.getQueryParams().get(1).getExpression().getELExpression()
);
Collections.sort(queryParamExpressionsA);
assertEquals("#{multiMappingBean.queryParameterForA}", queryParamExpressionsA.get(0));
assertEquals("#{multiMappingBean.queryParameterForBoth}", queryParamExpressionsA.get(1));
// validate mapping properties for mappingB
UrlMapping mappingB = config.getMappingById("mappingB");
assertNotNull(mappingB);
assertEquals("mappingB", mappingB.getId());
assertEquals("/some/url/b", mappingB.getPattern());
assertEquals("/view.jsf", mappingB.getViewId());
assertEquals(true, mappingB.isOutbound());
assertEquals(true, mappingB.isOnPostback());
assertEquals(2, mappingB.getActions().size());
assertEquals(1, mappingB.getQueryParams().size());
assertEquals(0, mappingB.getPathValidators().size());
assertEquals("#{multiMappingBean.queryParameterForBoth}",
mappingB.getQueryParams().get(0).getExpression().getELExpression());
// we don't know the order in which the actions are added
List<String> actionExpressionsB = Arrays.asList(
mappingB.getActions().get(0).getAction().getELExpression(),
mappingB.getActions().get(1).getAction().getELExpression()
);
Collections.sort(actionExpressionsB);
assertEquals("#{multiMappingBean.actionForBoth}", actionExpressionsB.get(0));
assertEquals("#{multiMappingBean.actionForB}", actionExpressionsB.get(1));