src/test/java/com/digitalglobe/util/maven/plugin/TestCloudFormationDeploy.java
/**
     * Use this method to test the Deploy Maven Plugin for a master stack and a secondary stack scenario.
     */
Use this method to test the Deploy Maven Plugin for a master stack and a secondary stack scenario.
Use this method to test the Deploy Maven Plugin for a master stack and a secondary stack scenario .
@Test(groups = {"unit"})
    public void TestTwoStackDeploy() throws Exception {
        StackScenario.createTest = false;
        StackScenario.changeset = true;
        OverridePlugin plugin =  new OverridePlugin();
        String stackPath = this.getClass().getClassLoader().getResource("Test-Template.json").getPath();
        String parameterPath = this.getClass().getClassLoader().getResource("Test-Parameters.json").getPath();
        Exception ex = plugin.beginTesting("bucket","aws:iam::1111:role/test", "Test",
                "test-repository", "com.test", "application-test", "1.0",
                "Test", stackPath, new String[] {parameterPath},
                new CloudFormationDeployMavenPlugin.StackGroup[]
                        {new CloudFormationDeployMavenPlugin.StackGroup()
                                .withRepositoryFilter("-test-")
                                .withStacks(new CloudFormationDeployMavenPlugin.SecondaryStack[]
                                {new CloudFormationDeployMavenPlugin.SecondaryStack()
                                        .withStackName("Test")
                                        .withStackPath(stackPath)
                                        .withStackParameterFilePath(parameterPath)
                                })
                        },
                new CloudFormationDeployMavenPlugin.StackInputParameter[]
                        {
                                new CloudFormationDeployMavenPlugin.StackInputParameter()
                                        .withParameterName("s3Bucket")
                                        .withMatchingParameterName("ArtifactS3Bucket"),
                                new CloudFormationDeployMavenPlugin.StackInputParameter()
                                        .withParameterName("s3Key")
                                        .withMatchingParameterName("ArtifactS3Key")
                        }, null);
        Assert.assertNull(ex);
        validateLogFile(true, true, false);
    }
@ Test ( groups = { "unit" } ) public void TestTwoStackDeploy ( ) throws Exception { StackScenario . createTest = false ; StackScenario . changeset = true ; OverridePlugin plugin = new OverridePlugin ( ) ; String stackPath = this . getClass ( ) . getClassLoader ( ) . getResource ( "Test-Template.json" ) . getPath ( ) ; String parameterPath = this . getClass ( ) . getClassLoader ( ) . getResource ( "Test-Parameters.json" ) . getPath ( ) ; Exception ex = plugin . beginTesting ( "bucket" , "aws:iam::1111:role/test" , "Test" , "test-repository" , "com.test" , "application-test" , "1.0" , "Test" , stackPath , new String [ ] { parameterPath } , new CloudFormationDeployMavenPlugin . StackGroup [ ] { new CloudFormationDeployMavenPlugin . StackGroup ( ) . withRepositoryFilter ( "-test-" ) . withStacks ( new CloudFormationDeployMavenPlugin . SecondaryStack [ ] { new CloudFormationDeployMavenPlugin . SecondaryStack ( ) . withStackName ( "Test" ) . withStackPath ( stackPath ) . withStackParameterFilePath ( parameterPath ) } ) } , new CloudFormationDeployMavenPlugin . StackInputParameter [ ] { new CloudFormationDeployMavenPlugin . StackInputParameter ( ) . withParameterName ( "s3Bucket" ) . withMatchingParameterName ( "ArtifactS3Bucket" ) , new CloudFormationDeployMavenPlugin . StackInputParameter ( ) . withParameterName ( "s3Key" ) . withMatchingParameterName ( "ArtifactS3Key" ) } , null ) ; Assert . assertNull ( ex ) ; validateLogFile ( true , true , false ) ; }
Use this method to test the Deploy Maven Plugin for a master stack and a secondary stack scenario.
Use this method to test the Deploy Maven Plugin for a master stack and a secondary stack scenario .
// Validate the log information to determine if the function ran successfully.