Java Code Examples for org.elasticmq.rest.sqs.SQSRestServerBuilder#start()

The following examples show how to use org.elasticmq.rest.sqs.SQSRestServerBuilder#start() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqsIOTest.java    From beam with Apache License 2.0 6 votes vote down vote up
@Override
protected void before() {
  sqsRestServer = SQSRestServerBuilder.start();

  String endpoint = "http://localhost:9324";
  String region = "elasticmq";
  String accessKey = "x";
  String secretKey = "x";

  client =
      AmazonSQSClientBuilder.standard()
          .withCredentials(
              new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
          .withEndpointConfiguration(
              new AwsClientBuilder.EndpointConfiguration(endpoint, region))
          .build();
  final CreateQueueResult queue = client.createQueue("test");
  queueUrl = queue.getQueueUrl();
}
 
Example 2
Source File: AWSQueueIT.java    From para with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUpClass() throws InterruptedException {
	System.setProperty("para.aws_sqs_local", "true");
	sqsServer = SQSRestServerBuilder.start();
	Thread.sleep(1000);
	q = new AWSQueue("testq");
}
 
Example 3
Source File: ApplicationTest.java    From examples with Apache License 2.0 4 votes vote down vote up
private void createElasticMQMockServer()
{
  // By default the urls will use http://localhost:9324 as the base URL
  mockServer = SQSRestServerBuilder.start();
}