Class AbstractStartSamMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
net.officefloor.maven.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 Details

    • 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 Details

    • AbstractStartSamMojo

      public AbstractStartSamMojo()
  • Method Details

    • ensureTemplateYamlFileExists

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

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

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

      public DockerNetworkInstance dockerNetwork() throws org.apache.maven.plugin.MojoExecutionException
      Ensure the docker network is created.
      Returns:
      DockerNetworkInstance.
      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 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 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.