m_editGatewayPage.saveValid(cycle);
m_editGatewayPage.saveGateway();
    public void testSaveAndAssign() {        DialingRule rule = new CustomDialingRule();        rule.setUniqueId();        rule.setName("my rule name");        Gateway g = new Gateway();        g.setUniqueId();        MockControl dialPlanContextControl = MockControl                .createStrictControl(DialPlanContext.class);        dialPlanContextControl.setDefaultMatcher(MockControl.EQUALS_MATCHER);        DialPlanContext dialPlanContext = (DialPlanContext) dialPlanContextControl.getMock();        MockControl contextControl = MockControl.createStrictControl(GatewayContext.class);        contextControl.setDefaultMatcher(MockControl.EQUALS_MATCHER);        GatewayContext context = (GatewayContext) contextControl.getMock();        context.storeGateway(g);        dialPlanContext.getRule(rule.getId());        dialPlanContextControl.setReturnValue(rule);        dialPlanContext.storeRule(rule);        dialPlanContextControl.replay();        contextControl.replay();        m_editGatewayPage.setDialPlanManager(dialPlanContext);        m_editGatewayPage.setGatewayContext(context);        m_editGatewayPage.setGateway(g);        m_editGatewayPage.setRuleId(rule.getId());        m_editGatewayPage.setNextPage("EditCustomDialRule");        m_editGatewayPage.pageBeginRender(null);        MockControl cycleControl = MockControl.createStrictControl(IRequestCycle.class);        IRequestCycle cycle = (IRequestCycle) cycleControl.getMock();        cycleControl.replay();        m_editGatewayPage.saveValid(cycle);        cycleControl.verify();        dialPlanContextControl.verify();        contextControl.verify();        assertEquals(1, rule.getGateways().size());        assertTrue(rule.getGateways().contains(g));    }