@@ -0,0 +1,2257 @@
+package com.github.zaplatynski.firstspirit.modules.fsm;%0A%0Aimport org.apache.maven.artifact.Artifact;%0Aimport org.apache.maven.plugin.MojoFailureException;%0Aimport org.apache.maven.project.MavenProject;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.needle4j.annotation.InjectInto;%0Aimport org.needle4j.annotation.Mock;%0Aimport org.needle4j.annotation.ObjectUnderTest;%0Aimport org.needle4j.junit.NeedleBuilders;%0Aimport org.needle4j.junit.NeedleRule;%0A%0Aimport java.io.File;%0Aimport java.util.Arrays;%0A%0Aimport static java.lang.Boolean.FALSE;%0Aimport static java.lang.Boolean.TRUE;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * Created by marza on 24.04.17.%0A */%0Apublic class FsmMojoTest %7B%0A%0A  @Rule%0A  public NeedleRule needleRule = NeedleBuilders%0A      .needleMockitoRule()%0A      .build();%0A%0A  @Mock%0A  @InjectInto(targetComponentId = %22testling%22, fieldName = %22project%22)%0A  private MavenProject project;%0A%0A  @InjectInto(targetComponentId = %22testling%22, fieldName = %22source%22)%0A  private File source = new File(%22target/module.zip%22);%0A%0A  @InjectInto(targetComponentId = %22testling%22, fieldName = %22target%22)%0A  private File target = new File(%22target/module.fsm%22);%0A%0A  @Mock%0A  private Artifact artifact;%0A%0A  @ObjectUnderTest(id = %22testling%22)%0A  private FsmMojo testling = new FsmMojo();%0A%0A  @Before%0A  public void setUp() throws Exception %7B%0A    source.createNewFile();%0A  %7D%0A%0A  @After%0A  public void tearDown() throws Exception %7B%0A    if(target.exists()) %7B%0A      target.delete();%0A    %7D%0A    if(source.exists()) %7B%0A      source.delete();%0A    %7D%0A  %7D%0A%0A  @Test%0A  public void execute() throws Exception %7B%0A%0A    when(project.getArtifact()).thenReturn(artifact);%0A%0A    assertThat(source.exists(), is(TRUE));%0A    assertThat(target.exists(), is(FALSE));%0A%0A    testling.execute();%0A%0A    assertThat(source.exists(), is(FALSE));%0A    assertThat(target.exists(), is(TRUE));%0A%0A    verify(artifact).setFile(target);%0A  %7D%0A%0A  @Test(expected = MojoFailureException.class)%0A  public void executeAlreadyAttached() throws Exception %7B%0A    when(project.getAttachedArtifacts()).thenReturn(Arrays.asList(artifact));%0A%0A    testling.execute();%0A  %7D%0A%0A%0A%7D

Add more Maven Mojo tests