Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

servlet: update catalog and bom #70

Merged
merged 1 commit into from
May 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ public void process(MavenProject project, CamelCatalog catalog, Map<String, Came
artifacts.put(artifact.getArtifactId(), artifact);
}

// ************************
//
// camel-k-runtime-servlet
//
// ************************

{
CamelArtifact artifact = new CamelArtifact();
artifact.setGroupId("org.apache.camel.k");
artifact.setArtifactId("camel-k-runtime-servlet");
artifact.addDependency("org.apache.camel", "camel-servlet");

artifacts.put(artifact.getArtifactId(), artifact);
}

// ************************
//
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,21 @@ public void process(MavenProject project, CamelCatalog catalog, Map<String, Came
artifacts.put(artifact.getArtifactId(), artifact);
}

// ************************
//
// camel-k-runtime-servlet
//
// ************************

{
CamelArtifact artifact = new CamelArtifact();
artifact.setGroupId("org.apache.camel.k");
artifact.setArtifactId("camel-k-runtime-servlet");
artifact.addDependency("org.apache.camel", "camel-servlet");

artifacts.put(artifact.getArtifactId(), artifact);
}

// ************************
//
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@

package org.apache.camel.k.tooling.maven.processors;

import java.util.HashMap;
import java.util.Map;

import org.apache.camel.catalog.CamelCatalog;
import org.apache.camel.k.tooling.maven.model.CamelArtifact;
import org.apache.camel.k.tooling.maven.model.CatalogProcessor;
import org.apache.maven.project.MavenProject;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -68,4 +74,45 @@ public void testAcceptMoreThanHigher(){

assertThat(cp2.accepts(catalog)).isFalse();
}

@Test
public void testArtifactsEnrichment(){
CatalogProcessor processor = new CatalogProcessor_2_x();
CamelCatalog catalog = versionCamelCatalog("2.23.2");
Map<String, CamelArtifact> artifactMap = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't better to test against 2.23.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


assertThat(processor.accepts(catalog)).isTrue();
processor.process(new MavenProject(), catalog, artifactMap);


assertThat(artifactMap.get("camel-k-runtime-jvm")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-core")
);
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel.k") && d.getArtifactId().equals("camel-k-adapter-camel-2")
);
});
assertThat(artifactMap.get("camel-k-runtime-groovy")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-groovy")
);
});
assertThat(artifactMap.get("camel-k-runtime-health")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-netty4-http")
);
});
assertThat(artifactMap.get("camel-k-runtime-servlet")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-servlet")
);
});

assertThat(artifactMap.get("camel-knative")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-netty4-http")
);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@

package org.apache.camel.k.tooling.maven.processors;

import java.util.HashMap;
import java.util.Map;

import org.apache.camel.catalog.CamelCatalog;
import org.apache.camel.k.tooling.maven.model.CamelArtifact;
import org.apache.camel.k.tooling.maven.model.CatalogProcessor;
import org.apache.maven.project.MavenProject;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -68,4 +74,45 @@ public void testAcceptMoreThanHigher(){

assertThat(cp3.accepts(catalog)).isFalse();
}

@Test
public void testArtifactsEnrichment(){
CatalogProcessor processor = new CatalogProcessor_3_x();
CamelCatalog catalog = versionCamelCatalog("3.0.0");
Map<String, CamelArtifact> artifactMap = new HashMap<>();

assertThat(processor.accepts(catalog)).isTrue();
processor.process(new MavenProject(), catalog, artifactMap);


assertThat(artifactMap.get("camel-k-runtime-jvm")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-core")
);
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel.k") && d.getArtifactId().equals("camel-k-adapter-camel-3")
);
});
assertThat(artifactMap.get("camel-k-runtime-groovy")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-groovy")
);
});
assertThat(artifactMap.get("camel-k-runtime-health")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-netty4-http")
);
});
assertThat(artifactMap.get("camel-k-runtime-servlet")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-servlet")
);
});

assertThat(artifactMap.get("camel-knative")).satisfies(a -> {
assertThat(a.getDependencies()).anyMatch(
d -> d.getGroupId().equals("org.apache.camel") && d.getArtifactId().equals("camel-netty4-http")
);
});
}
}
5 changes: 5 additions & 0 deletions camel-k-runtime-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
<artifactId>camel-k-runtime-health</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-k-runtime-servlet</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.k</groupId>
<artifactId>camel-knative</artifactId>
Expand Down