Class AbstractStartSamMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    RunSamMojo, StartSamMojo

    public abstract class AbstractStartSamMojo
    extends org.apache.maven.plugin.AbstractMojo
    Starts SAM for the integration testing.
    Author:
    Daniel Sagenschneider
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int samPort
      Port for servicing SAM.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • samPort

        @Parameter(required=true,
                   property="sam.port")
        protected int samPort

        Port for servicing SAM.

        Must be specified so that project is clear on integration test ports. This avoids possible changing default port number.

    • Constructor Detail

      • AbstractStartSamMojo

        public AbstractStartSamMojo()
    • Method Detail

      • ensureTemplateYamlFileExists

        public void ensureTemplateYamlFileExists()
                                          throws org.apache.maven.plugin.MojoExecutionException
        Ensures the template.yaml file exists.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • samBuild

        public void samBuild()
                      throws org.apache.maven.plugin.MojoExecutionException
        Undertakes SAM build.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • copyDependencies

        public void copyDependencies()
                              throws org.apache.maven.plugin.MojoExecutionException
        Copies in the maven dependencies.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • dockerNetwork

        public DockerNetworkInstance dockerNetwork()
                                            throws org.apache.maven.plugin.MojoExecutionException
        Ensure the docker network is created.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If fails to create network.
      • dynamoDb

        public DockerContainerInstance dynamoDb()
                                         throws org.apache.maven.plugin.MojoExecutionException
        Starts DynamoDB.
        Returns:
        DockerContainerInstance for managing DynamoDB.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If fails to start.
      • samLocalStartApi

        public java.lang.Process samLocalStartApi()
                                           throws org.apache.maven.plugin.MojoExecutionException
        Starts the local SAM server.
        Returns:
        Process for the local SAM server.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If fails to start.
      • startSam

        public java.lang.Runnable startSam()
                                    throws org.apache.maven.plugin.MojoExecutionException,
                                           org.apache.maven.plugin.MojoFailureException
        Starts SAM
        Returns:
        Runnable to stop.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If execution issue.
        org.apache.maven.plugin.MojoFailureException - If failure.