Package org.mokai.connector.http

Examples of org.mokai.connector.http.HttpConnector


    Message message = new Message();
    message.setProperty("to", "3002175604");
    message.setProperty("from", "3542");
    message.setProperty("text", "test · script @áÁ");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(message);

    Assert.assertEquals(mockHandler.getReceivedMethod(), "GET");
    mockHandler.validateExpectedProperties("to=3002175604&from=3542&text=test · script @áÁ");
    Assert.assertTrue(message.getProperty("responseCode", Integer.class) == HttpStatus.SC_OK);
  }
View Full Code Here


    configuration.setUrl("http://" + getHost() + ":" + getPort() + "/?to=3002175604");

    Message message = new Message();
    message.setProperty("from", "3542");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(message);

    mockHandler.validateExpectedProperties("to=3002175604&from=3542");
  }
View Full Code Here

    testServer.register("/", mockHandler);

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setUrl("http://invalid:port/");

    HttpConnector connector = new HttpConnector(configuration);
    connector.configure();
  }
View Full Code Here

    testServer.register("/", mockHandler);

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setUrl("htp://invalidscheme/");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());
  }
View Full Code Here

    Message message = new Message();
    message.setProperty("to", "3002175604");
    message.setProperty("from", "3542");
    message.setProperty("text", "test · script @áÁ");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(message);

    Assert.assertEquals(mockHandler.getReceivedMethod(), "POST");
    mockHandler.validateExpectedProperties("to=3002175604&from=3542&text=test · script @áÁ");
    Assert.assertTrue(message.getProperty("responseCode", Integer.class) == HttpStatus.SC_OK);
  }
View Full Code Here

    MockRequestHandler mockHandler = new MockRequestHandler(HttpStatus.SC_OK);
    testServer.register("/", mockHandler);

    HttpConfiguration configuration = new HttpConfiguration();

    HttpConnector connector = new HttpConnector(configuration);
    connector.configure();

  }
View Full Code Here

    MockRequestHandler mockHandler = new MockRequestHandler(HttpStatus.SC_OK);
    testServer.register("/", mockHandler);

    HttpConfiguration configuration = new HttpConfiguration();

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());

  }
View Full Code Here

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setUrl("http://" + getHost() + ":" + getPort() + "/");
    configuration.setMethod("UNKNOWN");

    HttpConnector connector = new HttpConnector(configuration);
    connector.configure();

  }
View Full Code Here

    HttpConfiguration configuration = new HttpConfiguration();
    configuration.setUrl("http://" + getHost() + ":" + getPort() + "/");
    configuration.setMethod("UNKNOWN");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());
  }
View Full Code Here

    configuration.setMethod("GET");
    configuration.setBasicAuth(true);
    configuration.setUsername("german");
    configuration.setPassword("password");

    HttpConnector connector = new HttpConnector(configuration);
    connector.process(new Message());

    Header header = mockHandler.getHeader("Authorization");
    Assert.assertNotNull(header);
    Assert.assertNotNull(header.getValue());
    Assert.assertEquals(header.getValue(), "Basic Z2VybWFuOnBhc3N3b3Jk");
View Full Code Here

TOP

Related Classes of org.mokai.connector.http.HttpConnector

Copyright © 2018 www.massapicom. 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.