use of com.netflix.conductor.contribs.queue.sqs.SQSObservableQueue in project conductor by Netflix.
the class TestSQSEventQueueProvider method testGetQueueWithCustomConfiguration.
@Test
public void testGetQueueWithCustomConfiguration() {
when(configuration.getIntProperty(eq("workflow.event.queues.sqs.batchSize"), anyInt())).thenReturn(10);
when(configuration.getIntProperty(eq("workflow.event.queues.sqs.pollTimeInMS"), anyInt())).thenReturn(50);
when(configuration.getIntProperty(eq("workflow.event.queues.sqs.visibilityTimeoutInSeconds"), anyInt())).thenReturn(30);
ListQueuesResult listQueuesResult = new ListQueuesResult().withQueueUrls("test_queue_1");
when(amazonSQSClient.listQueues(any(ListQueuesRequest.class))).thenReturn(listQueuesResult);
SQSEventQueueProvider sqsEventQueueProvider = new SQSEventQueueProvider(amazonSQSClient, configuration, Schedulers.from(Executors.newSingleThreadExecutor()));
SQSObservableQueue sqsObservableQueue = (SQSObservableQueue) sqsEventQueueProvider.getQueue("test_queue_1");
assertNotNull(sqsObservableQueue);
assertEquals(10, sqsObservableQueue.getBatchSize());
assertEquals(50, sqsObservableQueue.getPollTimeInMS());
assertEquals(30, sqsObservableQueue.getVisibilityTimeoutInSeconds());
}
use of com.netflix.conductor.contribs.queue.sqs.SQSObservableQueue in project conductor by Netflix.
the class TestSQSEventQueueProvider method testGetQueueWithDefaultConfiguration.
@Test
public void testGetQueueWithDefaultConfiguration() {
when(configuration.getIntProperty(anyString(), anyInt())).thenAnswer(invocation -> invocation.getArguments()[1]);
ListQueuesResult listQueuesResult = new ListQueuesResult().withQueueUrls("test_queue_1");
when(amazonSQSClient.listQueues(any(ListQueuesRequest.class))).thenReturn(listQueuesResult);
SQSEventQueueProvider sqsEventQueueProvider = new SQSEventQueueProvider(amazonSQSClient, configuration, Schedulers.from(Executors.newSingleThreadExecutor()));
SQSObservableQueue sqsObservableQueue = (SQSObservableQueue) sqsEventQueueProvider.getQueue("test_queue_1");
assertNotNull(sqsObservableQueue);
assertEquals(1, sqsObservableQueue.getBatchSize());
assertEquals(100, sqsObservableQueue.getPollTimeInMS());
assertEquals(60, sqsObservableQueue.getVisibilityTimeoutInSeconds());
}
Aggregations