Skip to content

Commit

Permalink
servlet: update catalog and bom
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed May 22, 2019
1 parent 72c9d2a commit 58d17c6
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
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.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-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

0 comments on commit 58d17c6

Please sign in to comment.