diff --git a/README.md b/README.md index 1c99bfe6b..93325328e 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Have a quick look at our online demo instance: ## Requirements - NodeJS (v18.x or higher) [+info](https://nodejs.org/en) - Yarn (v3.x or higher) [+info](https://yarnpkg.com/getting-started/install) -- OpenJDK (v21 or higher) [+info](https://developers.redhat.com/products/openjdk/download) +- OpenJDK (v17 or higher) [+info](https://developers.redhat.com/products/openjdk/download) _For more information on Vite, check [Vite's documentation](https://vitejs.dev/config/)._ diff --git a/packages/catalog-generator/pom.xml b/packages/catalog-generator/pom.xml index 12cb85ca8..eea4cac5a 100644 --- a/packages/catalog-generator/pom.xml +++ b/packages/catalog-generator/pom.xml @@ -11,10 +11,9 @@ A Camel Catalog generator for Kaoto. https://kaoto.io - 3.13.0 - 21 - 21 - 21 + 17 + 17 + 17 UTF-8 UTF-8 4.8.0 @@ -23,6 +22,7 @@ 2.17.2 5.11.0 6.13.3 + 3.5.0 3.13.0 3.5.0 @@ -160,6 +160,26 @@ + + org.apache.maven.plugins + maven-enforcer-plugin + ${version.maven-enforcer-plugin} + + + enforce-java-version + + enforce + + + + + [17,) + + + + + + maven-compiler-plugin ${version.maven-compiler-plugin} diff --git a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java index 0d537da8f..fa95c3be1 100644 --- a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java +++ b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java @@ -399,15 +399,31 @@ public String getEntityCatalog() throws Exception { var entityName = entry.getKey(); var entitySchema = entry.getValue(); var entityCatalog = catalogMap.get(entityName); + switch (entityName) { - case "beans" -> processBeansParameters(entitySchema, entityCatalog); - case "from" -> processFromParameters(entitySchema, entityCatalog); - case "route" -> processRouteParameters(entitySchema, entityCatalog); - case "routeTemplate" -> processRouteTemplateParameters(entitySchema, entityCatalog); - case "templatedRoute" -> processTemplatedRouteParameters(entitySchema, entityCatalog); - case "restConfiguration" -> processRestConfigurationParameters(entitySchema, entityCatalog); - case "rest" -> processRestParameters(entitySchema, entityCatalog); - case null, default -> processEntityParameters(entityName, entitySchema, entityCatalog); + case "beans": + processBeansParameters(entitySchema, entityCatalog); + break; + case "from": + processFromParameters(entitySchema, entityCatalog); + break; + case "route": + processRouteParameters(entitySchema, entityCatalog); + break; + case "routeTemplate": + processRouteTemplateParameters(entitySchema, entityCatalog); + break; + case "templatedRoute": + processTemplatedRouteParameters(entitySchema, entityCatalog); + break; + case "restConfiguration": + processRestConfigurationParameters(entitySchema, entityCatalog); + break; + case "rest": + processRestParameters(entitySchema, entityCatalog); + break; + default: + processEntityParameters(entityName, entitySchema, entityCatalog); } sortPropertiesAccordingToCamelCatalog(entitySchema, entityCatalog); diff --git a/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/commands/GenerateCommandTest.java b/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/commands/GenerateCommandTest.java index 76b2ecb17..3d5c01bdd 100644 --- a/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/commands/GenerateCommandTest.java +++ b/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/commands/GenerateCommandTest.java @@ -59,7 +59,7 @@ void testGeneratorCalledWithCorrectParameters() { })) { generateCommand.run(); - CatalogGeneratorBuilder builder = mockedBuilder.constructed().getFirst(); + CatalogGeneratorBuilder builder = mockedBuilder.constructed().get(0); verify(builder, times(1)).withRuntime(CatalogRuntime.Main); verify(builder, times(1)).withCamelCatalogVersion("4.8.0"); @@ -99,12 +99,12 @@ void testCatalogLibraryOutput() { ) { generateCommand.run(); - CatalogLibrary library = mockedLibrary.constructed().getFirst(); + CatalogLibrary library = mockedLibrary.constructed().get(0); assertEquals(library.getName(), "test-camel-catalog"); assertEquals(library.getDefinitions().size(), 1); - CatalogLibraryEntry catalogLibraryEntry = library.getDefinitions().getFirst(); + CatalogLibraryEntry catalogLibraryEntry = library.getDefinitions().get(0); assertEquals(catalogLibraryEntry.name(), "test-camel-catalog"); assertEquals(catalogLibraryEntry.version(), "4.8.0"); assertEquals(catalogLibraryEntry.runtime(), "Main");