PackageMojo extends AbstractMuleMojo { protected String getFileName() { return project.getBuild().getFinalName() + "-" + getClassifier() + "." + getType(); }  @Override void doExecute(); @Override String getPreviousRunPlaceholder();  }
@Test public void getFileNameMuleDomainTest() { String classifier = Classifier.MULE_DOMAIN.toString(); when(projectMock.getPackaging()).thenReturn(PackagingType.MULE_DOMAIN.toString()); mojo.classifier = classifier; String expectedFileName = FINAL_NAME + "-" + classifier + "." + TYPE; assertThat("Final name is not the expected", mojo.getFileName(), equalTo(expectedFileName)); }
@Test public void getFileNameMuleApplicationTest() { String classifier = Classifier.MULE_APPLICATION.toString(); when(projectMock.getPackaging()).thenReturn(PackagingType.MULE_APPLICATION.toString()); mojo.classifier = classifier; String expectedFileName = FINAL_NAME + "-" + classifier + "." + TYPE; assertThat("Final name is not the expected", mojo.getFileName(), equalTo(expectedFileName)); }
@Test public void getFileNameMuleApplicationExampleTest() { String classifier = Classifier.MULE_APPLICATION_EXAMPLE.toString(); when(projectMock.getPackaging()).thenReturn(PackagingType.MULE_APPLICATION.toString()); mojo.classifier = classifier; String expectedFileName = FINAL_NAME + "-" + classifier + "." + TYPE; assertThat("Final name is not the expected", mojo.getFileName(), equalTo(expectedFileName)); }
@Test public void getFileNameMuleApplicationExampleLighPackageTest() { mojo.lightweightPackage = true; String classifier = Classifier.MULE_APPLICATION_EXAMPLE.toString(); when(projectMock.getPackaging()).thenReturn(MULE_APPLICATION); mojo.classifier = classifier; String expectedFileName = FINAL_NAME + "-" + classifier + "-" + LIGHT_PACKAGE_CLASSIFIER + "." + TYPE; assertThat("Final name is not the expected", mojo.getFileName(), equalTo(expectedFileName)); }