assertOkResponse(thrift.setQuota(ROLE, resourceAggregate, SESSION));
}
@Test
public void testMachineMaintainerAccess() throws Exception {
Hosts hosts = new Hosts()
.setHostNames(ImmutableSet.of("host1"));
Set<HostStatus> statuses = ImmutableSet.of();
expectAuth(ROOT, false);
expectAuth(MACHINE_MAINTAINER, true);
expect(maintenance.startMaintenance(hosts.getHostNames())).andReturn(statuses);
expectAuth(ROOT, false);
expectAuth(MACHINE_MAINTAINER, true);
expect(maintenance.drain(hosts.getHostNames())).andReturn(statuses);
expectAuth(ROOT, false);
expectAuth(MACHINE_MAINTAINER, true);
expect(maintenance.getStatus(hosts.getHostNames())).andReturn(statuses);
expectAuth(ROOT, false);
expectAuth(MACHINE_MAINTAINER, true);
expect(maintenance.endMaintenance(hosts.getHostNames())).andReturn(statuses);
control.replay();
assertOkResponse(thrift.startMaintenance(hosts, SESSION));
assertOkResponse(thrift.drainHosts(hosts, SESSION));