26272829303132
public class AuthMatchTests { private AuthMatch match; @Test(expected = IllegalArgumentException.class) public void create_noPatterns() { new AuthMatch(null, new AuthGrant[0]); }
3132333435363738
new AuthMatch(null, new AuthGrant[0]); } @Test public void getPattern() { match = new AuthMatch("test", new AuthGrant[0]); assertEquals("/test", match.getPattern().getPatternName()); }
3738394041424344
assertEquals("/test", match.getPattern().getPatternName()); } @Test public void getGrants() { match = new AuthMatch("test", new AuthGrant[] { new AuthGrant() }); assertEquals(1, match.getGrants().length); }
4344454647484950515253
assertEquals(1, match.getGrants().length); } @Test public void toString_() { match = new AuthMatch("test", new AuthGrant[] { new AuthGrant() }); String s = ""; s += "Match {\n"; s += " pattern = /test\n";
52535455565758
match("/**/*.vm", grant(null, "*", "*", null)) // }); } private AuthMatch match(String target, AuthGrant... grants) { return new AuthMatch(target, grants); }