Search in sources :

Example 11 with DeployResults

use of io.fabric8.deployer.dto.DeployResults in project fabric8 by jboss-fuse.

the class DeployToProfileMojoTest method before.

// Fixtures setup
@Before
public void before() {
    mojo.fabricServer = mock(Server.class);
    project = new MavenProject();
    project.setGroupId("io.fabric8");
    project.setArtifactId("artifact");
    project.setVersion(FABRIC_VERSION);
    mojo.project = project;
    deployResults = new DeployResults();
    deployResults.setProfileId("profileId");
    deployResults.setVersionId("versionId");
}
Also used : DeployResults(io.fabric8.deployer.dto.DeployResults) Server(org.apache.maven.settings.Server) MavenProject(org.apache.maven.project.MavenProject) Before(org.junit.Before)

Example 12 with DeployResults

use of io.fabric8.deployer.dto.DeployResults in project fabric8 by jboss-fuse.

the class DeployToProfileMojoTest method shouldExpandProjectGroupIdPlaceholder.

// Tests
@Test
public void shouldExpandProjectGroupIdPlaceholder() throws IOException, J4pException, MalformedObjectNameException, MojoExecutionException {
    // Given
    File config = new File(root, randomUUID().toString());
    String property = "groupId = " + PLACEHOLDER_PROJECT_GROUP_ID;
    writeToFile(config, property.getBytes());
    // When
    mojo.uploadProfileConfigFile(jolokiaClient, deployResults, root, config);
    String decodedConfig = decodeSentConfig();
    // Then
    String expectedConfig = "groupId = " + project.getGroupId();
    assertEquals(expectedConfig, decodedConfig);
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) Files.writeToFile(io.fabric8.common.util.Files.writeToFile) File(java.io.File) Test(org.junit.Test)

Aggregations

DeployResults (io.fabric8.deployer.dto.DeployResults)5 ProjectRequirements (io.fabric8.deployer.dto.ProjectRequirements)5 File (java.io.File)5 Files.writeToFile (io.fabric8.common.util.Files.writeToFile)4 Test (org.junit.Test)4 Matchers.anyString (org.mockito.Matchers.anyString)4 Profile (io.fabric8.api.Profile)2 ProfileBuilder (io.fabric8.api.ProfileBuilder)2 DependencyDTO (io.fabric8.deployer.dto.DependencyDTO)2 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 Server (org.apache.maven.settings.Server)2 J4pRemoteException (org.jolokia.client.exception.J4pRemoteException)2 DownloadManager (io.fabric8.agent.download.DownloadManager)1 Feature (io.fabric8.agent.model.Feature)1 FabricRequirements (io.fabric8.api.FabricRequirements)1 ProfileRequirements (io.fabric8.api.ProfileRequirements)1 ProfileService (io.fabric8.api.ProfileService)1 Version (io.fabric8.api.Version)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1