@Test
public void testBlacklistRejection() throws Exception {

  ResourceBlacklistRequest blacklistRequest =
      ResourceBlacklistRequest.newInstance(
          Arrays.asList("h1", "h2"), new ArrayList<>());
  List<ResourceRequest> reqs =
      Arrays.asList(ResourceRequest.newInstance(PRIORITY_NORMAL,
          "*", CAPABILITY_1GB, 1, true, null, OPPORTUNISTIC_REQ));
  ApplicationAttemptId appAttId = ApplicationAttemptId.newInstance(
      ApplicationId.newInstance(0L, 1), 1);
  oppCntxt.updateNodeList(
      Arrays.asList(
          RemoteNode.newInstance(
              NodeId.newInstance("h1", 1234), "h1:1234", "/r1"),
          RemoteNode.newInstance(
              NodeId.newInstance("h2", 1234), "h2:1234", "/r2")));
  List<Container> containers = allocator.allocateContainers(
      blacklistRequest, reqs, appAttId, oppCntxt, 1L, "luser");
  Assert.assertEquals(0, containers.size());
  Assert.assertEquals(1, oppCntxt.getOutstandingOpReqs().size());
}