View Javadoc
1   /*
2    * Copyright (c) 2016 ingenieux Labs
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package br.com.ingenieux.mojo.beanstalk;
18  
19  import org.codehaus.plexus.configuration.PlexusConfiguration;
20  import org.junit.Ignore;
21  
22  import java.io.File;
23  
24  import br.com.ingenieux.mojo.beanstalk.version.RollbackVersionMojo;
25  
26  @Ignore
27  public class RollbackVersionMojoTest extends BeanstalkTestBase {
28  
29    private RollbackVersionMojo mojo;
30  
31    @Override
32    protected void setUp() throws Exception {
33      super.setUp();
34  
35      File testPom = super.getBasePom("pom.xml");
36  
37      PlexusConfiguration pluginConfiguration = extractPluginConfiguration("beanstalk-maven-plugin", testPom);
38  
39      RollbackVersionMojo mojo = (RollbackVersionMojo) configureMojo(new RollbackVersionMojo(), pluginConfiguration);
40  
41      this.mojo = mojo;
42    }
43  
44    public void ignoretestPreviousVersion() throws Exception {
45      setVariableValueToObject(mojo, "applicationName", "belemtransito");
46      setVariableValueToObject(mojo, "environmentName", "production");
47  
48      mojo.execute();
49    }
50  
51    public void ignoretestLatestInstead() throws Exception {
52      setVariableValueToObject(mojo, "applicationName", "belemtransito");
53      setVariableValueToObject(mojo, "environmentName", "production");
54      setVariableValueToObject(mojo, "latestVersionInstead", true);
55  
56      mojo.execute();
57    }
58  }