StandaloneDeploymentValidator extends AbstractDeploymentValidator { @Override public EnvironmentSupportedVersions getEnvironmentSupportedVersions() throws DeploymentException { File muleHome = ((StandaloneDeployment) deployment).getMuleHome(); checkArgument(muleHome != null, "Mule home cannot not be null"); checkArgument(muleHome.exists(), "Mule home directory does not exist"); String muleRuntimeVersion = findRuntimeVersion(muleHome); return new EnvironmentSupportedVersions(muleRuntimeVersion); } StandaloneDeploymentValidator(Deployment deployment); @Override EnvironmentSupportedVersions getEnvironmentSupportedVersions();  }
@Test public void getEnvironmentSupportedVersionsTest() throws Exception { temporaryFolder.create(); File muleHome = temporaryFolder.getRoot(); standaloneDeployment.setMuleHome(muleHome); validatorSpy = spy(new StandaloneDeploymentValidator(standaloneDeployment)); doReturn(MULE_VERSION).when(validatorSpy, "findRuntimeVersion", muleHome); assertThat("Supported version that was generated is not the expected", validatorSpy.getEnvironmentSupportedVersions(), equalTo(EXPECTED_ENVIRONMENT_SUPPORTED_VERSIONS)); }