Class EmbeddedServerUnderTest

  • All Implemented Interfaces:
    io.micronaut.context.ApplicationContextProvider, ServerUnderTest, java.io.Closeable, java.lang.AutoCloseable

    public class EmbeddedServerUnderTest
    extends java.lang.Object
    implements ServerUnderTest
    ServerUnderTest implementation for EmbeddedServer.
    Since:
    3.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      EmbeddedServerUnderTest​(java.util.Map<java.lang.String,​java.lang.Object> properties)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      <I,​O>
      io.micronaut.http.HttpResponse<O>
      exchange​(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<O> bodyType)  
      io.micronaut.context.ApplicationContext getApplicationContext()  
      java.util.Optional<java.lang.Integer> getPort()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EmbeddedServerUnderTest

        public EmbeddedServerUnderTest​(@NonNull
                                       java.util.Map<java.lang.String,​java.lang.Object> properties)
    • Method Detail

      • exchange

        public <I,​O> io.micronaut.http.HttpResponse<O> exchange​(io.micronaut.http.HttpRequest<I> request,
                                                                      io.micronaut.core.type.Argument<O> bodyType)
        Specified by:
        exchange in interface ServerUnderTest
      • getApplicationContext

        public io.micronaut.context.ApplicationContext getApplicationContext()
        Specified by:
        getApplicationContext in interface io.micronaut.context.ApplicationContextProvider
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • getPort

        @NonNull
        public java.util.Optional<java.lang.Integer> getPort()
        Specified by:
        getPort in interface ServerUnderTest