Search in sources :

Example 1 with RequestOptions

use of com.google.spanner.v1.RequestOptions in project java-spanner by googleapis.

the class AbstractReadContextTest method testBuildRequestOptions.

@Test
public void testBuildRequestOptions() {
    RequestOptions requestOptions = context.buildRequestOptions(Options.fromQueryOptions());
    assertEquals(RequestOptions.Priority.PRIORITY_UNSPECIFIED, requestOptions.getPriority());
}
Also used : RequestOptions(com.google.spanner.v1.RequestOptions) Test(org.junit.Test)

Example 2 with RequestOptions

use of com.google.spanner.v1.RequestOptions in project java-spanner by googleapis.

the class AbstractReadContextTest method testBuildRequestOptionsWithPriority.

@Test
public void testBuildRequestOptionsWithPriority() {
    RequestOptions requestOptionsHighPriority = context.buildRequestOptions(Options.fromQueryOptions(Options.priority(RpcPriority.HIGH)));
    assertEquals(RequestOptions.Priority.PRIORITY_HIGH, requestOptionsHighPriority.getPriority());
    RequestOptions requestOptionsMediumPriority = context.buildRequestOptions(Options.fromQueryOptions(Options.priority(RpcPriority.MEDIUM)));
    assertEquals(RequestOptions.Priority.PRIORITY_MEDIUM, requestOptionsMediumPriority.getPriority());
    RequestOptions requestOptionsLowPriority = context.buildRequestOptions(Options.fromQueryOptions(Options.priority(RpcPriority.LOW)));
    assertEquals(RequestOptions.Priority.PRIORITY_LOW, requestOptionsLowPriority.getPriority());
}
Also used : RequestOptions(com.google.spanner.v1.RequestOptions) Test(org.junit.Test)

Aggregations

RequestOptions (com.google.spanner.v1.RequestOptions)2 Test (org.junit.Test)2