@Test public void testGetTransportTypeOfDefault() throws Exception { HttpTransportFactory.HttpTransportType type = HttpTransportFactory.getTransportTypeOf(null); assertEquals(HttpTransportType.JAVA_NET, type); type = HttpTransportFactory.getTransportTypeOf(""); assertEquals(HttpTransportType.JAVA_NET, type); }
@Test public void testGetTransportTypeOf() throws Exception { HttpTransportFactory.HttpTransportType type = HttpTransportFactory.getTransportTypeOf("JAVA_NET"); assertEquals(HttpTransportFactory.HttpTransportType.JAVA_NET, type); type = HttpTransportFactory.getTransportTypeOf("APACHE"); assertEquals(HttpTransportType.APACHE, type); }
@Test public void testGetTransportTypeOfException() throws Exception { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Invalid HttpTransport type 'com.google.api.client.http.apache.ApacheHttpTransport'." + " Must be one of [APACHE, JAVA_NET]."); HttpTransportFactory.getTransportTypeOf( "com.google.api.client.http.apache.ApacheHttpTransport"); }