Search in sources :

Example 1 with ServiceOptions

use of com.google.cloud.ServiceOptions in project google-cloud-java by GoogleCloudPlatform.

the class HttpTransportOptionsTest method testHeader.

@Test
public void testHeader() {
    String expectedHeaderPattern = "^gl-java/.* gccl/0.0.0";
    final ServiceOptions mockOptions = EasyMock.createMock(ServiceOptions.class);
    EasyMock.expect(mockOptions.getLibraryVersion()).andReturn("0.0.0");
    EasyMock.replay(mockOptions);
    assertTrue(Pattern.compile(expectedHeaderPattern).matcher(OPTIONS.getXGoogApiClientHeader(mockOptions)).find());
}
Also used : ServiceOptions(com.google.cloud.ServiceOptions) Test(org.junit.Test)

Aggregations

ServiceOptions (com.google.cloud.ServiceOptions)1 Test (org.junit.Test)1