This is an automated email from the ASF dual-hosted git repository. lburgazzoli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 1060ba90ef91e6ff56d4ff8b98583752fc4596b9 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Wed Nov 13 11:38:29 2019 +0100 Fixes #411 bean-validator extension --- .../pages/list-of-camel-quarkus-extensions.adoc | 3 + extensions/bean-validator/deployment/pom.xml | 75 ++++++++++++ .../deployment/BeanValidatorProcessor.java | 31 +++++ extensions/bean-validator/pom.xml | 39 ++++++ extensions/bean-validator/runtime/pom.xml | 82 +++++++++++++ .../main/resources/META-INF/quarkus-extension.yaml | 27 +++++ extensions/pom.xml | 1 + extensions/readme.adoc | 3 + integration-tests/bean-validator/pom.xml | 132 +++++++++++++++++++++ .../bean/validator/it/BeanValidatorResource.java | 56 +++++++++ .../bean/validator/it/BeanValidatorRoute.java | 30 +++++ .../component/bean/validator/it/model/Car.java | 52 ++++++++ .../bean/validator/it/BeanValidatorIT.java | 24 ++++ .../bean/validator/it/BeanValidatorTest.java | 33 ++++++ integration-tests/pom.xml | 1 + poms/bom-deployment/pom.xml | 10 ++ poms/bom/pom.xml | 10 ++ 17 files changed, 609 insertions(+) diff --git a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc index 52b065c..439be68 100644 --- a/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc +++ b/docs/modules/ROOT/pages/list-of-camel-quarkus-extensions.adoc @@ -27,6 +27,9 @@ Number of Camel components: 34 in 30 JAR artifacts (0 deprecated) | link:https://camel.apache.org/components/latest/bean-component.html[Bean] (camel-quarkus-bean) + `bean:beanName` | 0.2 | The bean component is for invoking Java beans from Camel. +| link:https://camel.apache.org/components/latest/bean-validator-component.html[Bean Validator] (camel-quarkus-bean-validator) + +`bean-validator:label` | 0.4 | The Validator component performs bean validation of the message body using the Java Bean Validation API. + | link:https://camel.apache.org/components/latest/class-component.html[Class] (camel-quarkus-bean) + `class:beanName` | 0.2 | The class component is for invoking Java classes (Java beans) from Camel. diff --git a/extensions/bean-validator/deployment/pom.xml b/extensions/bean-validator/deployment/pom.xml new file mode 100644 index 0000000..b5f9abe --- /dev/null +++ b/extensions/bean-validator/deployment/pom.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator-parent</artifactId> + <version>0.3.2-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-bean-validator-deployment</artifactId> + <name>Camel Quarkus :: Bean Validator :: Deployment</name> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom-deployment</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core-deployment</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> + +</project> diff --git a/extensions/bean-validator/deployment/src/main/java/org/apache/camel/quarkus/component/bean/validator/deployment/BeanValidatorProcessor.java b/extensions/bean-validator/deployment/src/main/java/org/apache/camel/quarkus/component/bean/validator/deployment/BeanValidatorProcessor.java new file mode 100644 index 0000000..1b9be1b --- /dev/null +++ b/extensions/bean-validator/deployment/src/main/java/org/apache/camel/quarkus/component/bean/validator/deployment/BeanValidatorProcessor.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean.validator.deployment; + +import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.builditem.FeatureBuildItem; + +class BeanValidatorProcessor { + + private static final String FEATURE = "camel-bean-validator"; + + @BuildStep + FeatureBuildItem feature() { + return new FeatureBuildItem(FEATURE); + } + +} diff --git a/extensions/bean-validator/pom.xml b/extensions/bean-validator/pom.xml new file mode 100644 index 0000000..bef510b --- /dev/null +++ b/extensions/bean-validator/pom.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-build-parent</artifactId> + <version>0.3.2-SNAPSHOT</version> + <relativePath>../../poms/build-parent/pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-bean-validator-parent</artifactId> + <name>Camel Quarkus :: Bean Validator</name> + <packaging>pom</packaging> + + <modules> + <module>deployment</module> + <module>runtime</module> + </modules> +</project> diff --git a/extensions/bean-validator/runtime/pom.xml b/extensions/bean-validator/runtime/pom.xml new file mode 100644 index 0000000..2cc3b91 --- /dev/null +++ b/extensions/bean-validator/runtime/pom.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator-parent</artifactId> + <version>0.3.2-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>camel-quarkus-bean-validator</artifactId> + <name>Camel Quarkus :: Bean Validator :: Runtime</name> + + <properties> + <firstVersion>0.4.0</firstVersion> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bom</artifactId> + <version>${project.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> + <artifactId>camel-bean-validator</artifactId> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-bootstrap-maven-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <annotationProcessorPaths> + <path> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-extension-processor</artifactId> + <version>${quarkus.version}</version> + </path> + </annotationProcessorPaths> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/extensions/bean-validator/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/bean-validator/runtime/src/main/resources/META-INF/quarkus-extension.yaml new file mode 100644 index 0000000..4650bd8 --- /dev/null +++ b/extensions/bean-validator/runtime/src/main/resources/META-INF/quarkus-extension.yaml @@ -0,0 +1,27 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +--- +name: "Camel Quarkus Bean Validator" +description: "Camel Java Beans Validation support" +metadata: + keywords: + - "camel" + - "bean" + guide: "https://quarkus.io/guides/camel" + categories: + - "integration" \ No newline at end of file diff --git a/extensions/pom.xml b/extensions/pom.xml index 40f62f5..e1c1730 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -82,6 +82,7 @@ <module>vm</module> <module>zipfile</module> <module>xslt</module> + <module>bean-validator</module> </modules> diff --git a/extensions/readme.adoc b/extensions/readme.adoc index 4b87922..c233963 100644 --- a/extensions/readme.adoc +++ b/extensions/readme.adoc @@ -26,6 +26,9 @@ Number of Camel components: 34 in 30 JAR artifacts (0 deprecated) | link:https://camel.apache.org/components/latest/bean-component.html[Bean] (camel-quarkus-bean) + `bean:beanName` | 0.2 | The bean component is for invoking Java beans from Camel. +| link:https://camel.apache.org/components/latest/bean-validator-component.html[Bean Validator] (camel-quarkus-bean-validator) + +`bean-validator:label` | 0.4 | The Validator component performs bean validation of the message body using the Java Bean Validation API. + | link:https://camel.apache.org/components/latest/class-component.html[Class] (camel-quarkus-bean) + `class:beanName` | 0.2 | The class component is for invoking Java classes (Java beans) from Camel. diff --git a/integration-tests/bean-validator/pom.xml b/integration-tests/bean-validator/pom.xml new file mode 100644 index 0000000..55c0662 --- /dev/null +++ b/integration-tests/bean-validator/pom.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-tests</artifactId> + <version>0.3.2-SNAPSHOT</version> + </parent> + + <artifactId>camel-quarkus-integration-test-bean-validator</artifactId> + <name>Camel Quarkus :: Integration Tests :: Bean Validator</name> + <description>Integration tests for Camel Quarkus Bean Validator extension</description> + + <dependencies> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator</artifactId> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-direct</artifactId> + </dependency> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-resteasy</artifactId> + </dependency> + + <!-- test dependencies --> + <dependency> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-junit5</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.rest-assured</groupId> + <artifactId>rest-assured</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>build</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>native</id> + <activation> + <property> + <name>native</name> + </property> + </activation> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + <configuration> + <systemProperties> + <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> + </systemProperties> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>io.quarkus</groupId> + <artifactId>quarkus-maven-plugin</artifactId> + <executions> + <execution> + <id>native-image</id> + <goals> + <goal>native-image</goal> + </goals> + <configuration> + <reportErrorsAtRuntime>false</reportErrorsAtRuntime> + <cleanupServer>true</cleanupServer> + <enableHttpsUrlHandler>true</enableHttpsUrlHandler> + <enableServer>false</enableServer> + <dumpProxies>false</dumpProxies> + <graalvmHome>${graalvmHome}</graalvmHome> + <enableJni>true</enableJni> + <enableAllSecurityServices>true</enableAllSecurityServices> + <disableReports>true</disableReports> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + +</project> diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java new file mode 100644 index 0000000..5bf17e0 --- /dev/null +++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorResource.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean.validator.it; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.apache.camel.Exchange; +import org.apache.camel.ProducerTemplate; +import org.apache.camel.quarkus.component.bean.validator.it.model.Car; +import org.jboss.logging.Logger; + +@Path("/bean-validator") +@ApplicationScoped +public class BeanValidatorResource { + + private static final Logger LOG = Logger.getLogger(BeanValidatorResource.class); + + @Inject + ProducerTemplate producerTemplate; + + @Path("/get/{manufactor}/{plate}") + @GET + @Produces(MediaType.TEXT_PLAIN) + public Response get(@PathParam("manufactor") String manufactor, @PathParam("plate") String plate) throws Exception { + LOG.info("bean-validator: " + manufactor + "/" + plate); + Car car = new Car(manufactor, plate); + Exchange out = producerTemplate.request("direct:start", e -> e.getMessage().setBody(car)); + if (out.isFailed()) { + return Response.status(400, "Invalid car").build(); + } else { + return Response.status(200, "OK").build(); + } + } + +} diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java new file mode 100644 index 0000000..76a7c7d --- /dev/null +++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorRoute.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean.validator.it; + +import org.apache.camel.builder.RouteBuilder; + +public class BeanValidatorRoute extends RouteBuilder { + + @Override + public void configure() throws Exception { + errorHandler(noErrorHandler()); + + from("direct:start") + .to("bean-validator:car"); + } +} diff --git a/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java new file mode 100644 index 0000000..19db6f8 --- /dev/null +++ b/integration-tests/bean-validator/src/main/java/org/apache/camel/quarkus/component/bean/validator/it/model/Car.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean.validator.it.model; + +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; + +public class Car { + + @NotNull + private String manufacturer; + + @NotNull + @Size(min = 5, max = 14) + private String licensePlate; + + public Car(String manufacturer, String licencePlate) { + this.manufacturer = manufacturer; + this.licensePlate = licencePlate; + } + + public String getManufacturer() { + return manufacturer; + } + + public void setManufacturer(String manufacturer) { + this.manufacturer = manufacturer; + } + + public String getLicensePlate() { + return licensePlate; + } + + public void setLicensePlate(String licensePlate) { + this.licensePlate = licensePlate; + } + +} diff --git a/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorIT.java b/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorIT.java new file mode 100644 index 0000000..314f46c --- /dev/null +++ b/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorIT.java @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean.validator.it; + +import io.quarkus.test.junit.NativeImageTest; + +@NativeImageTest +class BeanValidatorIT extends BeanValidatorTest { + +} diff --git a/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java b/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java new file mode 100644 index 0000000..8e91c67 --- /dev/null +++ b/integration-tests/bean-validator/src/test/java/org/apache/camel/quarkus/component/bean/validator/it/BeanValidatorTest.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.component.bean.validator.it; + +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.RestAssured; +import org.junit.jupiter.api.Test; + +@QuarkusTest +class BeanValidatorTest { + + @Test + public void test() { + RestAssured.get("/bean-validator/get/honda/123").then().statusCode(400); + + RestAssured.get("/bean-validator/get/honda/DD-AB-123").then().statusCode(200); + } + +} diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index 4a84df9..1338bdf 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -111,6 +111,7 @@ <module>validator</module> <module>zipfile</module> <module>xslt</module> + <module>bean-validator</module> </modules> diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml index 07ecc41..8cdce86 100644 --- a/poms/bom-deployment/pom.xml +++ b/poms/bom-deployment/pom.xml @@ -110,6 +110,11 @@ </dependency> <dependency> <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator-deployment</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> <artifactId>camel-quarkus-core-cloud-deployment</artifactId> <version>${camel-quarkus.version}</version> </dependency> @@ -308,6 +313,11 @@ <artifactId>camel-quarkus-xslt-deployment</artifactId> <version>${camel-quarkus.version}</version> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator-deployment</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> </dependencies> </dependencyManagement> diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml index a75a539..1369d1a 100644 --- a/poms/bom/pom.xml +++ b/poms/bom/pom.xml @@ -91,6 +91,11 @@ </dependency> <dependency> <groupId>org.apache.camel</groupId> + <artifactId>camel-bean-validator</artifactId> + <version>${camel.version}</version> + </dependency> + <dependency> + <groupId>org.apache.camel</groupId> <artifactId>camel-caffeine-lrucache</artifactId> <version>${camel.version}</version> </dependency> @@ -610,6 +615,11 @@ <artifactId>camel-quarkus-xslt</artifactId> <version>${camel-quarkus.version}</version> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-bean-validator</artifactId> + <version>${camel-quarkus.version}</version> + </dependency> </dependencies> </dependencyManagement>