use of org.mule.runtime.deployment.model.api.application.ApplicationDescriptor in project mule by mulesoft.
the class DefaultArchiveDeployerTestCase method createMockApplication.
private Application createMockApplication() {
Application artifact = mock(Application.class);
ApplicationDescriptor descriptor = mock(ApplicationDescriptor.class);
when(descriptor.getDataFolderName()).thenReturn(ARTIFACT_ID);
when(artifact.getDescriptor()).thenReturn(descriptor);
when(artifact.getArtifactName()).thenReturn(ARTIFACT_ID);
return artifact;
}
use of org.mule.runtime.deployment.model.api.application.ApplicationDescriptor in project mule by mulesoft.
the class DefaultConnectivityTestingServiceBuilder method build.
/**
* {@inheritDoc}
*/
@Override
public ConnectivityTestingService build() {
checkState(artifactDeclaration != null, "artifact configuration cannot be null");
return new TemporaryArtifactConnectivityTestingService(() -> {
String applicationName = UUID.getUUID() + "-connectivity-testing-temp-app";
File applicationFolder = new File(getExecutionFolder(), applicationName);
ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor(applicationName);
applicationDescriptor.setArtifactDeclaration(artifactDeclaration);
applicationDescriptor.setConfigResources(emptySet());
applicationDescriptor.setArtifactLocation(applicationFolder);
createDeployablePomFile(applicationFolder, model);
updateArtifactPom(applicationFolder, model);
MavenClientProvider mavenClientProvider = MavenClientProvider.discoverProvider(DefaultConnectivityTestingServiceBuilder.class.getClassLoader());
applicationDescriptor.setClassLoaderModel(new DeployableMavenClassLoaderModelLoader(mavenClientProvider.createMavenClient(GlobalConfigLoader.getMavenConfig()), mavenClientProvider.getLocalRepositorySuppliers()).load(applicationFolder, emptyMap(), ArtifactType.APP));
return defaultApplicationFactory.createArtifact(applicationDescriptor);
});
}
Aggregations