File tree Expand file tree Collapse file tree
main/java/io/github/swagger2markup
test/java/io/github/swagger2markup Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,8 +46,17 @@ public class Swagger2MarkupMojo extends AbstractMojo {
4646 @ Parameter
4747 protected Map <String , String > config = new HashMap <>();
4848
49+ @ Parameter (property = "skip" )
50+ protected boolean skip ;
51+
4952 @ Override
5053 public void execute () throws MojoExecutionException , MojoFailureException {
54+
55+ if (skip ) {
56+ getLog ().info ("convertSwagger2markup is skipped." );
57+ return ;
58+ }
59+
5160 if (getLog ().isDebugEnabled ()) {
5261 getLog ().debug ("convertSwagger2markup goal started" );
5362 getLog ().debug ("swaggerInput: " + swaggerInput );
Original file line number Diff line number Diff line change @@ -32,6 +32,20 @@ public void clearGeneratedData() throws Exception {
3232 FileUtils .deleteQuietly (outputDir );
3333 }
3434
35+ @ Test
36+ public void shouldSkipExecution () throws Exception {
37+ //given
38+ Swagger2MarkupMojo mojo = new Swagger2MarkupMojo ();
39+ mojo .outputFile = new File (OUTPUT_DIR , SWAGGER_OUTPUT_FILE ).getAbsoluteFile ();
40+ mojo .skip = true ;
41+
42+ //when
43+ mojo .execute ();
44+
45+ //then
46+ assertThat (mojo .outputFile ).doesNotExist ();
47+ }
48+
3549 @ Test
3650 public void shouldConvertIntoFile () throws Exception {
3751 //given
You can’t perform that action at this time.
0 commit comments