Search in sources :

Example 1 with RequestOptions

use of org.springframework.data.mongodb.core.messaging.SubscriptionRequest.RequestOptions in project spring-data-mongodb by spring-projects.

the class TaskFactoryUnitTests method createsTailableRequestCorrectly.

// DATAMONGO-1803
@Test
void createsTailableRequestCorrectly() {
    when(template.getConverter()).thenReturn(converter);
    RequestOptions options = Mockito.mock(RequestOptions.class);
    when(options.getCollectionName()).thenReturn("collection-1");
    Task task = factory.forRequest(new TailableCursorRequest(messageListener, options), Object.class, errorHandler);
    assertThat(task).isInstanceOf(TailableCursorTask.class);
}
Also used : ChangeStreamRequestOptions(org.springframework.data.mongodb.core.messaging.ChangeStreamRequest.ChangeStreamRequestOptions) RequestOptions(org.springframework.data.mongodb.core.messaging.SubscriptionRequest.RequestOptions) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 ChangeStreamRequestOptions (org.springframework.data.mongodb.core.messaging.ChangeStreamRequest.ChangeStreamRequestOptions)1 RequestOptions (org.springframework.data.mongodb.core.messaging.SubscriptionRequest.RequestOptions)1