src/test/java/com/digitalglobe/util/maven/plugin/TestCloudFormationDeploy.java
/**
     * Use this method to test the Deploy Maven Plugin in a scenario where the initiator configured the pom file
     * incorrectly by providing two master stack parameter files without specifying two secondary stacks.
     */
Use this method to test the Deploy Maven Plugin in a scenario where the initiator configured the pom file
incorrectly by providing two master stack parameter files without specifying two secondary stacks.
Use this method to test the Deploy Maven Plugin in a scenario where the initiator configured the pom file incorrectly by providing two master stack parameter files without specifying two secondary stacks .
@Test(groups = {"unit"})
    public void TestTooManyParametersDeploy() 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::1112:role/test", "Test",
                "test-repository", "com.test", "application-test", "1.0",
                "Test", stackPath, new String[] {parameterPath, parameterPath}, null,
                null, null);
        Assert.assertNotNull(ex);
        Assert.assertNotNull(ex.getCause());
        Assert.assertTrue(ex.getCause().getMessage().equals("Multiple Parameters without secondary stacks."));
        int position = 0;
        File touch = new File("target/audit.txt");
        Object[] lines = Files.lines(Paths.get(touch.toURI())).toArray();
        Assert.assertTrue(lines[position++].equals("Can't have multiple parameter files without secondary stacks."));
        Assert.assertTrue(lines[position++].equals("Error executing the template stack or stack group."));
        Assert.assertTrue(lines[position++].equals("Multiple Parameters without secondary stacks."));
        Assert.assertEquals(lines.length, position);
    }
@ Test ( groups = { "unit" } ) public void TestTooManyParametersDeploy ( ) 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::1112:role/test" , "Test" , "test-repository" , "com.test" , "application-test" , "1.0" , "Test" , stackPath , new String [ ] { parameterPath , parameterPath } , null , null , null ) ; Assert . assertNotNull ( ex ) ; Assert . assertNotNull ( ex . getCause ( ) ) ; Assert . assertTrue ( ex . getCause ( ) . getMessage ( ) . equals ( "Multiple Parameters without secondary stacks." ) ) ; int position = 0 ; File touch = new File ( "target/audit.txt" ) ; Object [ ] lines = Files . lines ( Paths . get ( touch . toURI ( ) ) ) . toArray ( ) ; Assert . assertTrue ( lines [ position ++ ] . equals ( "Can't have multiple parameter files without secondary stacks." ) ) ; Assert . assertTrue ( lines [ position ++ ] . equals ( "Error executing the template stack or stack group." ) ) ; Assert . assertTrue ( lines [ position ++ ] . equals ( "Multiple Parameters without secondary stacks." ) ) ; Assert . assertEquals ( lines . length , position ) ; }
Use this method to test the Deploy Maven Plugin in a scenario where the initiator configured the pom file
 incorrectly by providing two master stack parameter files without specifying two secondary stacks.
Use this method to test the Deploy Maven Plugin in a scenario where the initiator configured the pom file incorrectly by providing two master stack parameter files without specifying two secondary stacks .
// Validate the log information to determine if the function ran successfully. // Validate Array Sizes