NoAuthExecutor implements IAuthExecutor { @Override public AuthReport checkAllowed(Exchange exchange, Api api) { if(logger.isDebugEnabled()) { logger.debug("Check if the API allows NoAuth"); } return this.dataAccess.checkAllowed(api); } NoAuthExecutor(IAuthDataAccess dataAccess); @Override AuthReport checkAllowed(Exchange exchange, Api api); @Override AuthType getType(); @Override GatewayExceptionCode getErrorCode();  }
@Test public void testNoAuth() { Exchange exchange = new DefaultExchange(context); Api api = new Api(); api.setId("api3234"); MockAuthDataAccess mockDA = new MockAuthDataAccess(null, null, null); NoAuthExecutor executor = new NoAuthExecutor(mockDA); AuthReport authReport = executor.checkAllowed(exchange, api); assertNotNull("This authentication should have succeeded", authReport.getAuthIdentity()); }