@Test
public void testCheckHandlerMethodAccess() throws Exception {

    ViewPostMetadata viewPostMetadata = new ViewPostMetadata();
    model.setViewPostMetadata(viewPostMetadata);
    assertMethodAccess("Accessible annotation not picked up", "method1", true);
    assertMethodAccess("Custom method should be allowed due to not being in the available methods", "method2", true);
    viewPostMetadata.addAvailableMethodToCall( "method2" );
    assertMethodAccess("Accessible annotation picked up where not present", "method2", false);
    viewPostMetadata.addAccessibleMethodToCall("method4");
    viewPostMetadata.addAccessibleMethodToCall("method6");
    assertMethodAccess("Accessible method by view not picked up", "method4", true);
    assertMethodAccess("Accessible method by view not picked up", "method6", true);
    assertMethodAccess("Method not accessible for empty method to call", null, true);
}