rule.getTransformedPatterns();
rule.getTransformedPatterns(gateway);
    public void testGenerate() throws Exception {        Gateway gateway = new Gateway();        gateway.setUniqueId();        gateway.setAddress("10.1.2.3");        List gateways = new ArrayList();        gateways.add(gateway);        IMocksControl control = EasyMock.createControl();        IDialingRule rule = control.createMock(IDialingRule.class);        rule.getDescription();        control.andReturn("test rule description");        rule.getTransformedPatterns();        control.andReturn(new String[] {            "555", "666", "777"        });        rule.getPermissions();        control.andReturn(Arrays.asList(new Permission[] {            Permission.VOICEMAIL        }));        rule.getGateways();        control.andReturn(gateways);        rule.getName();        control.andReturn("testrule");        control.replay();        MockAuthRules authRules = new MockAuthRules();        authRules.begin();        authRules.generate(rule);        authRules.end();        Document document = authRules.getDocument();        String domDoc = XmlUnitHelper.asString(document);        assertXpathEvaluatesTo("test rule description", "/mappings/hostMatch/description", domDoc);        assertXpathEvaluatesTo(gateway.getAddress(), "/mappings/hostMatch/hostPattern", domDoc);        assertXpathEvaluatesTo("555", "/mappings/hostMatch/userMatch/userPattern", domDoc);        assertXpathEvaluatesTo("666", "/mappings/hostMatch/userMatch/userPattern[2]", domDoc);        assertXpathEvaluatesTo("777", "/mappings/hostMatch/userMatch/userPattern[3]", domDoc);        assertXpathEvaluatesTo("Voicemail",                "/mappings/hostMatch/userMatch/permissionMatch/permission", domDoc);        // check if generate no access has been called properly        assertEquals(1, authRules.uniqueGateways);        control.verify();    }