Class ManagerApiMicroService


  • public class ManagerApiMicroService
    extends Object
    This class starts up an embedded Jetty test server so that integration tests can be performed.
    Author:
    eric.wittmann@redhat.com
    • Constructor Detail

      • ManagerApiMicroService

        public ManagerApiMicroService()
        Constructor.
    • Method Detail

      • start

        public void start()
                   throws Exception
        Start/run the server.
        Throws:
        Exception - when any exception occurs
      • stop

        public void stop()
                  throws Exception
        Stop the server.
        Throws:
        Exception - when any exception occurs
      • serverPort

        public int serverPort()
        Returns:
        the server port.
      • addModulesToJetty

        protected void addModulesToJetty​(org.eclipse.jetty.server.handler.HandlerCollection handlers)
                                  throws Exception
        Configure the web application(s).
        Parameters:
        handlers -
        Throws:
        Exception
      • getTranslationsResource

        protected org.eclipse.jetty.util.resource.Resource getTranslationsResource​(String path)
        Returns:
        a resource representing the translations.js file
      • getConfigResource

        protected org.eclipse.jetty.util.resource.Resource getConfigResource​(String path)
        Returns:
        a resource representing the config.js file
      • addSecurityHandler

        protected void addSecurityHandler​(org.eclipse.jetty.servlet.ServletContextHandler apiManServer)
                                   throws Exception
        Parameters:
        apiManServer -
        Throws:
        Exception
      • addAuthFilter

        protected void addAuthFilter​(org.eclipse.jetty.servlet.ServletContextHandler apiManServer)
        Parameters:
        apiManServer -
      • createSecurityHandler

        protected org.eclipse.jetty.security.SecurityHandler createSecurityHandler()
                                                                            throws Exception
        Creates a basic auth security handler.
        Throws:
        Exception