jamesnetherton commented on code in PR #5123:
URL: https://github.com/apache/camel-quarkus/pull/5123#discussion_r1275975103
##########
integration-tests/mapstruct/src/test/java/org/apache/camel/quarkus/component/mapstruct/it/MapStructExplicitPackagesTestProfile.java:
##########
@@ -16,22 +16,16 @@
*/
package org.apache.camel.quarkus.component.mapstruct.it;
-import jakarta.inject.Named;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mapstruct.MapstructComponent;
-import org.apache.camel.quarkus.component.mapstruct.it.model.Car;
+import java.util.Map;
-public class MapStructRoutes extends RouteBuilder {
- @Named("mapstruct")
- MapstructComponent mapstruct() {
- MapstructComponent mapstruct = new MapstructComponent();
-
mapstruct.setMapperPackageName("org.apache.camel.quarkus.component.mapstruct.it.mapper");
- return mapstruct;
- }
+import io.quarkus.test.junit.QuarkusTestProfile;
+import org.apache.camel.quarkus.component.mapstruct.it.mapper.car.CarMapper;
+import
org.apache.camel.quarkus.component.mapstruct.it.mapper.vehicle.VehicleMapper;
+public class MapStructExplicitPackagesTestProfile implements
QuarkusTestProfile {
@Override
- public void configure() throws Exception {
- from("direct:component").to("mapstruct:" + Car.class.getName());
- from("direct:converter").convertBodyTo(Car.class);
+ public Map<String, String> getConfigOverrides() {
+ return Map.of("camel.component.mapstruct.mapper-package-name",
+ String.join(",", CarMapper.class.getPackageName(),
VehicleMapper.class.getPackageName()));
Review Comment:
Should be fixed in `MapStructProcessor.getMapperPackages`. I used a helper
method from `commons-lang3`. It's a transitive from `quarkus-core-deployment`
so I think it's safe.
I also tweaked the `TestProfile` to include whitespace in the config prop as
a test for it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]