Search in sources :

Example 11 with HttpClientException

use of io.micronaut.http.client.exceptions.HttpClientException in project micronaut-core by micronaut-projects.

the class GoogleAuthFilterSpec method testApplyGoogleAuthFilter.

@Test
void testApplyGoogleAuthFilter() {
    HttpClientException e = Assertions.assertThrows(HttpClientException.class, () -> client.toBlocking().exchange("/google-auth/api/test"));
    String message = e.getMessage();
    assertTrue(message.contains("metadata: nodename nor servname provided") || message.contains("metadata: Temporary failure in name resolution") || message.contains("metadata: Name or service not known") || message.contains("Connect Error: No such host is known (metadata)"));
}
Also used : HttpClientException(io.micronaut.http.client.exceptions.HttpClientException) Test(org.junit.jupiter.api.Test) MicronautTest(io.micronaut.test.extensions.junit5.annotation.MicronautTest)

Aggregations

HttpClientException (io.micronaut.http.client.exceptions.HttpClientException)11 ByteBuffer (io.micronaut.core.io.buffer.ByteBuffer)6 ReferenceCounted (io.micronaut.core.io.buffer.ReferenceCounted)6 MutableHttpRequest (io.micronaut.http.MutableHttpRequest)6 NettyByteBufferFactory (io.micronaut.buffer.netty.NettyByteBufferFactory)5 AnnotationMetadata (io.micronaut.core.annotation.AnnotationMetadata)5 AnnotationMetadataResolver (io.micronaut.core.annotation.AnnotationMetadataResolver)5 Internal (io.micronaut.core.annotation.Internal)5 NonNull (io.micronaut.core.annotation.NonNull)5 Nullable (io.micronaut.core.annotation.Nullable)5 Publishers (io.micronaut.core.async.publisher.Publishers)5 BeanMap (io.micronaut.core.beans.BeanMap)5 ConversionService (io.micronaut.core.convert.ConversionService)5 ResourceResolver (io.micronaut.core.io.ResourceResolver)5 ByteBufferFactory (io.micronaut.core.io.buffer.ByteBufferFactory)5 OrderUtil (io.micronaut.core.order.OrderUtil)5 InstantiationUtils (io.micronaut.core.reflect.InstantiationUtils)5 Argument (io.micronaut.core.type.Argument)5 ArgumentUtils (io.micronaut.core.util.ArgumentUtils)5 ArrayUtils (io.micronaut.core.util.ArrayUtils)5