### Question:
FixFixtures { @Then("create a repeating group \"([^\"]*)\" with \"([^\"]*)\" in message \"([^\"]*)\"") public void createRepeatingGroupWithFields(String groupType, String params, String messageName) { Cdr message = getMessage(messageName); CdrItem groupItem = new CdrItem(CdrItem.CdrItemType.CDR_ARRAY); Cdr child = ParserUtils.stringToCdr(groupType, handlers.preTreatParams(params)); groupItem.addCdrToList(child); message.setItem(groupType, groupItem); } FixFixtures(EtiqetHandlers handlers); @Then("create a repeating group \"([^\"]*)\" in message \"([^\"]*)\"") void createRepeatingGroup(String groupType, String messageName); @Then("create a repeating group \"([^\"]*)\" with \"([^\"]*)\" in message \"([^\"]*)\"") void createRepeatingGroupWithFields(String groupType, String params, String messageName); @Then("create a repeating group \"([^\"]*)\" in group \"([^\"]*)\" in message \"([^\"]*)\"") void createRepeatingGroupInGroup(String groupType, String existingGroup, String messageName); @Then("create a repeating group \"([^\"]*)\" with \"([^\"]*)\" in group \"([^\"]*)\" in message \"([^\"]*)\"") void createRepeatingGroupWithFieldsInGroup(String groupType, String params, String existingGroup, String messageName); @Then("add fields \"([^\"]*)\" to \"([^\"]*)\" group in message \"([^\"]*)\"") void addFieldsToRepeatingGroup(String params, String groupType, String messageName);  }### Answer:
@Test public void testCreateRepeatingGroupWithFields() { Cdr fixMsg = new Cdr("TEST_FIX"); when(handlers.getSentMessage("testMessage")).thenReturn(fixMsg); when(handlers.preTreatParams(anyString())).thenCallRealMethod(); fixtures.createRepeatingGroupWithFields("NoSides", "Side=1,Currency=GBP", "testMessage"); assertTrue(fixMsg.containsKey("NoSides")); CdrItem parties = fixMsg.getItem("NoSides"); assertNotNull(parties); List<Cdr> childCdrs = parties.getCdrs(); assertNotNull(childCdrs); assertEquals(1, childCdrs.size()); Cdr child = childCdrs.get(0); assertTrue(child.containsKey("Side")); assertEquals("1", child.getAsString("Side")); assertTrue(child.containsKey("Currency")); assertEquals("GBP", child.getAsString("Currency")); }