From b3b5789c77159fce6d000d5ee4ff5aee5bd1cd80 Mon Sep 17 00:00:00 2001 From: Claus Ibsen Date: Fri, 29 Mar 2024 18:27:05 +0100 Subject: [PATCH] Upgrade to Camel 4.5.0 --- .../catalog/SpringBootJSonSchemaResolver.java | 15 +++++++++++++++ .../SpringBootJSonSchemaResolverTest.java | 18 +++++++++++++++--- ...sPropertyKeyCompletionSpringBootTestIT.java | 4 ++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/camel-idea-plugin/src/main/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolver.java b/camel-idea-plugin/src/main/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolver.java index 82074f9d..18e4e98c 100644 --- a/camel-idea-plugin/src/main/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolver.java +++ b/camel-idea-plugin/src/main/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolver.java @@ -128,6 +128,21 @@ public String getMainJsonSchema() { return schema == null ? delegate.getMainJsonSchema() : schema; } + @Override + public String getTransformerJSonSchema(String name) { + return delegate.getTransformerJSonSchema(name); + } + + @Override + public String getDevConsoleJSonSchema(String name) { + return delegate.getDevConsoleJSonSchema(name); + } + + @Override + public String getPojoBeanJSonSchema(String name) { + return delegate.getPojoBeanJSonSchema(name); + } + /** * Extract the properties found in the Spring configuration metadata, remove the properties whose name doesn't * start with {@code camel.component.${component-name}.} or contains {@code customizer} and inject the resulting diff --git a/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolverTest.java b/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolverTest.java index ffbfc618..1d4c2cfd 100644 --- a/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolverTest.java +++ b/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/catalog/SpringBootJSonSchemaResolverTest.java @@ -50,12 +50,10 @@ public void retrieveContentMainSchema() { assertNotEmpty(model.getGroups()); List groupNames = model.getGroups().stream().map(MainModel.MainGroupModel::getName) .collect(Collectors.toList()); - assertDoesntContain(groupNames, "camel.main"); assertContainsElements(groupNames, "camel.springboot", "camel.cloud", "camel.cluster.file"); assertNotEmpty(model.getOptions()); List optionNames = model.getOptions().stream().map(MainModel.MainOptionModel::getName) .collect(Collectors.toList()); - assertDoesntContain(optionNames, "camel.main.auto-startup", "camel.main.autoStartup"); assertContainsElements(optionNames, "camel.springboot.auto-startup", "camel.cluster.file.enabled"); } @@ -112,7 +110,6 @@ public static class MockJSonSchemaResolver implements JSonSchemaResolver { @Override public void setClassLoader(ClassLoader classLoader) { - } @Override @@ -167,5 +164,20 @@ public String getModelJSonSchema(String name) { public String getMainJsonSchema() { return null; } + + @Override + public String getTransformerJSonSchema(String name) { + return null; + } + + @Override + public String getDevConsoleJSonSchema(String name) { + return null; + } + + @Override + public String getPojoBeanJSonSchema(String name) { + return null; + } } } diff --git a/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/completion/PropertiesPropertyKeyCompletionSpringBootTestIT.java b/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/completion/PropertiesPropertyKeyCompletionSpringBootTestIT.java index 4904fb60..2f47db31 100644 --- a/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/completion/PropertiesPropertyKeyCompletionSpringBootTestIT.java +++ b/camel-idea-plugin/src/test/java/com/github/cameltooling/idea/completion/PropertiesPropertyKeyCompletionSpringBootTestIT.java @@ -50,8 +50,8 @@ public void testGroupSuggestion() { myFixture.completeBasic(); List strings = myFixture.getLookupElementStrings(); assertNotNull(strings); - assertDoesntContain(strings, "camel.main."); - assertContainsElements(strings, "camel.springboot.", "camel.component.", "camel.language.", "camel.dataformat."); + // camel.main is included in camel 4.5 onwards for SB also + assertContainsElements(strings, "camel.main.", "camel.springboot.", "camel.component.", "camel.language.", "camel.dataformat."); } /**