@Test(expectedExceptions = AccessControlException.class)
@TestDir
public void unknownHost() throws Exception {
String dir = getTestDir().getAbsolutePath();
XConfiguration conf = new XConfiguration();
conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
ProxyUserService.class.getName()), ","));
conf.set("server.proxyuser.foo.hosts", "localhost");
conf.set("server.proxyuser.foo.groups", "*");
Server server = new Server("server", dir, dir, dir, dir, conf);
server.init();
ProxyUser proxyUser = server.get(ProxyUser.class);
Assert.assertNotNull(proxyUser);
proxyUser.validate("foo", "unknownhost.bar.foo", "bar");