@Test(expected = IllegalArgumentException.class)
public void testInvalidAppState() {

  AppsBlock appBlock = new AppsBlock(null, null) {
    // override this so that apps block can fetch app state.
    @Override
    public Map<String, String> moreParams() {
      Map<String, String> map = new HashMap<>();
      map.put(YarnWebParams.APP_STATE, "ACCEPTEDPING");
      return map;
    }
    @Override
    protected void renderData(Block html) {
    }
  };
  // set up the test block to render AppsBlock
  OutputStream outputStream = new ByteArrayOutputStream();
  HtmlBlock.Block block = createBlockToCreateTo(outputStream);
  // If application state is invalid it should throw exception
  // instead of catching it.
  appBlock.render(block);
}