Package com.alu.e3.auth.camel.producer

Examples of com.alu.e3.auth.camel.producer.AuthProducer.process()


    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    // Anything will work for the mock executor... it just has to be set
    exchange.getIn().setHeader(AuthHttpHeaders.Authorization.toString(), "blarg");
   
    producer.process(exchange);
   
    testAuthenticated(exchange);
  }

  /**
 
View Full Code Here


  public void testFailHttpBasic() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&basic=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
  }

  /**
 
View Full Code Here

    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    // Anything will work for the mock executor... it just has to be set
    exchange.getIn().setHeader("appkey", "blarg");
   
    producer.process(exchange);
   
    testAuthenticated(exchange);
  }
 
  /**
 
View Full Code Here

  public void testFailAppKey() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&authKey=true&keyName=appkey");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
  }

  /**
 
View Full Code Here

    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    // Anything will work for the mock executor... it just has to be set
    exchange.getIn().setHeader("source-ip", "127.0.0.1");
   
    producer.process(exchange);
   
    testAuthenticated(exchange);
  }
 
  /**
 
View Full Code Here

  public void testFailWhitelist() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&ipList=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
  }
 
  
View Full Code Here

  public void testSuccessNoAuth() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&noAuth=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testAuthenticated(exchange);
  }
 
  @Test
View Full Code Here

  public void testFailNoAuth() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&noAuth=false");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
  }
 
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.