Deployment { protected void setBasicDeploymentValues(MavenProject project) throws DeploymentException { String muleApplicationName = getProperty("mule.application.name"); if (isNotBlank(muleApplicationName)) { setApplicationName(muleApplicationName); } if (isBlank(getApplicationName())) { setApplicationName(project.getArtifactId()); } String isSkip = getProperty("mule.skip"); if (isNotBlank(isSkip)) { setSkip(isSkip); } if (isBlank(getSkip())) { setSkip("false"); } String muleVersion = getProperty("mule.version"); if (isNotBlank(muleVersion)) { setMuleVersion(muleVersion); } String applicationPath = getProperty("mule.artifact"); if (isNotBlank(applicationPath)) { setArtifact(new File(applicationPath)); } if (getArtifact() == null) { if (project.getAttachedArtifacts().isEmpty()) { throw new DeploymentException("Artifact to be deployed could not be found. Please set its location setting -Dmule.artifact=path/to/jar or in the deployment configuration pom element"); } setArtifact(project.getAttachedArtifacts().get(0).getFile()); } String packaging = project.getPackaging(); if (isNotBlank(packaging)) { setPackaging(packaging); } String deploymentTimeout = getProperty("mule.deploymentConfiguration.timeout"); if (isNotBlank(deploymentTimeout)) { setDeploymentTimeout(Long.valueOf(deploymentTimeout)); } setArtifactId(project.getArtifactId()); setGroupId(project.getGroupId()); setVersion(project.getVersion()); }  File getArtifact(); void setArtifact(File artifact); String getApplicationName(); void setApplicationName(String applicationName); String getSkip(); void setSkip(String skip); Optional<String> getMuleVersion(); void setMuleVersion(String muleVersion); String getPackaging(); void setPackaging(String packaging); Optional<Long> getDeploymentTimeout(); void setDeploymentTimeout(Long deploymentTimeout); void setDefaultValues(MavenProject project); abstract void setEnvironmentSpecificValues(); void setArtifactId(String artifactId); void setGroupId(String groupId); void setVersion(String version); String getArtifactId(); String getGroupId(); String getVersion();  }
@Test public void setBasicDeploymentValuesApplicationFileNotSetTest() throws DeploymentException { System.clearProperty("mule.artifact"); expectedException.expect(DeploymentException.class); expectedException .expectMessage("Artifact to be deployed could not be found. Please set its location setting -Dmule.artifact=path/to/jar or in the deployment configuration pom element"); deploymentSpy.setBasicDeploymentValues(project); }