Package com.alu.e3.auth.camel.endpoint

Examples of com.alu.e3.auth.camel.endpoint.AuthEndpoint.createProducer()


   * @throws Exception
   */
  @Test
  public void testSuccessHttpBasic() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&basic=true");
    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);
View Full Code Here


   * This test the case where the endpoint is configured correctly and we expect a failed httpbasic authentication
   */
  @Test
  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

   * @throws Exception
   */
  @Test
  public void testSuccessAppKey() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&authKey=true&keyName=appkey");
    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);
View Full Code Here

   * This test the case where the endpoint is configured correctly and we expect a failed appkey authentication
   */
  @Test
  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

   * @throws Exception
   */
  @Test
  public void testSuccessWhitelist() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&ipList=true");
    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);
View Full Code Here

   * This test the case where the endpoint is configured correctly and we expect a failed whitelist authentication
   */
  @Test
  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

 
  
  @Test
  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);
View Full Code Here

  }
 
  @Test
  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.