Interface ServerUnderTest

All Superinterfaces:
io.micronaut.context.ApplicationContextProvider, AutoCloseable, Closeable
All Known Implementing Classes:
EmbeddedServerUnderTest

public interface ServerUnderTest extends io.micronaut.context.ApplicationContextProvider, Closeable, AutoCloseable
An API for a Micronaut HTTP Server under test. An implementation can be Netty or AWS Lambda Handler.
Since:
1.8.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The property name used to signify we want to use a non-blocking client.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <I, O> io.micronaut.http.HttpResponse<O>
    exchange(io.micronaut.http.HttpRequest<I> request)
     
    <I, O> io.micronaut.http.HttpResponse<O>
    exchange(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<O> bodyType)
     
    <I, O, E> io.micronaut.http.HttpResponse<O>
    exchange(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<O> bodyType, io.micronaut.core.type.Argument<E> errorType)
     
    default <I, O> io.micronaut.http.HttpResponse<O>
    exchange(io.micronaut.http.HttpRequest<I> request, Class<O> bodyType)
     
    default <I, O, E> io.micronaut.http.HttpResponse<O>
    exchange(io.micronaut.http.HttpRequest<I> request, Class<O> bodyType, Class<E> errorType)
     
    default @NonNull Optional<Integer>
     
    default Optional<String>
     
    default @NonNull Optional<URL>
     

    Methods inherited from interface io.micronaut.context.ApplicationContextProvider

    getApplicationContext

    Methods inherited from interface java.io.Closeable

    close
  • Field Details

    • BLOCKING_CLIENT_PROPERTY

      static final String BLOCKING_CLIENT_PROPERTY
      The property name used to signify we want to use a non-blocking client. This is used as the implementation varies for the javanet client.
      See Also:
  • Method Details

    • exchange

      default <I, O> io.micronaut.http.HttpResponse<O> exchange(io.micronaut.http.HttpRequest<I> request)
    • exchange

      default <I, O> io.micronaut.http.HttpResponse<O> exchange(io.micronaut.http.HttpRequest<I> request, Class<O> bodyType)
    • exchange

      default <I, O, E> io.micronaut.http.HttpResponse<O> exchange(io.micronaut.http.HttpRequest<I> request, Class<O> bodyType, Class<E> errorType)
    • exchange

      <I, O> io.micronaut.http.HttpResponse<O> exchange(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<O> bodyType)
    • exchange

      <I, O, E> io.micronaut.http.HttpResponse<O> exchange(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<O> bodyType, io.micronaut.core.type.Argument<E> errorType)
    • getScheme

      default Optional<String> getScheme()
    • getPort

      @NonNull default @NonNull Optional<Integer> getPort()
    • getURL

      @NonNull default @NonNull Optional<URL> getURL()