@Test
public void createEndpoint_useCustomTemplate() {

    Service testService =
            Services.serviceBuilder()
                    .serviceEndpointPrefix("foobar")
                    .serviceName("EndpointBuilderTest2")
                    .serviceEndpointTemplate("https://foobar2.{region}.oracle.com")
                    .build();
    assertEquals(
            "https://foobar2.us-phoenix-1.oracle.com",
            EndpointBuilder.createEndpoint(testService, Region.US_PHOENIX_1));
}