This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new a3ffe96 CAMEL-17499: Renaming inconsistent data format names in model
a3ffe96 is described below
commit a3ffe96d4a053379b92e693ab68068bb0b9fc779
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Jan 18 15:53:50 2022 +0100
CAMEL-17499: Renaming inconsistent data format names in model
---
.../apache/camel/springboot/catalog/dataformats.properties | 6 +++---
.../catalog/dataformats/{bindy-csv.json => bindyCsv.json} | 2 +-
.../dataformats/{bindy-fixed.json => bindyFixed.json} | 2 +-
.../catalog/dataformats/{bindy-kvp.json => bindyKvp.json} | 2 +-
.../springboot/catalog/SpringBootRuntimeProviderTest.java | 4 ++--
.../camel-bindy-starter/src/main/docs/bindy.json | 6 +++---
.../csv/springboot/BindyCsvDataFormatConfiguration.java | 4 ++--
.../BindyFixedLengthDataFormatConfiguration.java | 2 +-
.../BindyKeyValuePairDataFormatConfiguration.java | 4 ++--
.../org/apache/camel/itest/springboot/CamelBindyTest.java | 6 +++---
.../springboot/maven/SpringBootAutoConfigurationMojo.java | 14 ++++++++------
11 files changed, 27 insertions(+), 25 deletions(-)
diff --git
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties
index 27a5e6c..083e7d3 100644
---
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties
+++
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats.properties
@@ -5,9 +5,9 @@ avro-jackson
barcode
base64
beanio
-bindy-csv
-bindy-fixed
-bindy-kvp
+bindyCsv
+bindyFixed
+bindyKvp
cbor
crypto
csv
diff --git
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-csv.json
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyCsv.json
similarity index 99%
rename from
catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-csv.json
rename to
catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyCsv.json
index 9525f02..f76cbc5 100644
---
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-csv.json
+++
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyCsv.json
@@ -1,7 +1,7 @@
{
"dataformat": {
"kind": "dataformat",
- "name": "bindy-csv",
+ "name": "bindyCsv",
"title": "Bindy CSV",
"description": "Marshal and unmarshal between POJOs and Comma separated
values (CSV) format using Camel Bindy",
"deprecated": false,
diff --git
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-fixed.json
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyFixed.json
similarity index 98%
rename from
catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-fixed.json
rename to
catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyFixed.json
index 97d2882..1630de8 100644
---
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-fixed.json
+++
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyFixed.json
@@ -1,7 +1,7 @@
{
"dataformat": {
"kind": "dataformat",
- "name": "bindy-fixed",
+ "name": "bindyFixed",
"title": "Bindy Fixed Length",
"description": "Marshal and unmarshal between POJOs and fixed field length
format using Camel Bindy",
"deprecated": false,
diff --git
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-kvp.json
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyKvp.json
similarity index 99%
rename from
catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-kvp.json
rename to
catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyKvp.json
index 4a4aaed..990f91f 100644
---
a/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindy-kvp.json
+++
b/catalog/camel-catalog-provider-springboot/src/main/resources/org/apache/camel/springboot/catalog/dataformats/bindyKvp.json
@@ -1,7 +1,7 @@
{
"dataformat": {
"kind": "dataformat",
- "name": "bindy-kvp",
+ "name": "bindyKvp",
"title": "Bindy Key Value Pair",
"description": "Marshal and unmarshal between POJOs and key-value pair
(KVP) format using Camel Bindy",
"deprecated": false,
diff --git
a/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java
b/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java
index c4e78b6..aff4eb7 100644
---
a/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java
+++
b/catalog/camel-catalog-provider-springboot/src/test/java/org/apache/camel/springboot/catalog/SpringBootRuntimeProviderTest.java
@@ -74,7 +74,7 @@ public class SpringBootRuntimeProviderTest {
assertNotNull(names);
assertFalse(names.isEmpty());
- assertTrue(names.contains("bindy-csv"));
+ assertTrue(names.contains("bindyCsv"));
assertTrue(names.contains("zipdeflater"));
assertTrue(names.contains("zipfile"));
}
@@ -114,7 +114,7 @@ public class SpringBootRuntimeProviderTest {
@Test
public void testDataFormatArtifactId() throws Exception {
- String json = catalog.dataFormatJSonSchema("bindy-csv");
+ String json = catalog.dataFormatJSonSchema("bindyCsv");
assertNotNull(json);
assertTrue(json.contains("camel-bindy-starter"));
diff --git a/components-starter/camel-bindy-starter/src/main/docs/bindy.json
b/components-starter/camel-bindy-starter/src/main/docs/bindy.json
index 1440e82..1a9471d 100644
--- a/components-starter/camel-bindy-starter/src/main/docs/bindy.json
+++ b/components-starter/camel-bindy-starter/src/main/docs/bindy.json
@@ -56,7 +56,7 @@
{
"name": "camel.dataformat.bindy-csv.enabled",
"type": "java.lang.Boolean",
- "description": "Whether to enable auto configuration of the bindy-csv
data format. This is enabled by default.",
+ "description": "Whether to enable auto configuration of the bindyCsv
data format. This is enabled by default.",
"sourceType":
"org.apache.camel.dataformat.bindy.csv.springboot.BindyCsvDataFormatConfiguration"
},
{
@@ -99,7 +99,7 @@
{
"name": "camel.dataformat.bindy-fixed.enabled",
"type": "java.lang.Boolean",
- "description": "Whether to enable auto configuration of the bindy-fixed
data format. This is enabled by default.",
+ "description": "Whether to enable auto configuration of the bindyFixed
data format. This is enabled by default.",
"sourceType":
"org.apache.camel.dataformat.bindy.fixed.springboot.BindyFixedLengthDataFormatConfiguration"
},
{
@@ -142,7 +142,7 @@
{
"name": "camel.dataformat.bindy-kvp.enabled",
"type": "java.lang.Boolean",
- "description": "Whether to enable auto configuration of the bindy-kvp
data format. This is enabled by default.",
+ "description": "Whether to enable auto configuration of the bindyKvp
data format. This is enabled by default.",
"sourceType":
"org.apache.camel.dataformat.bindy.kvp.springboot.BindyKeyValuePairDataFormatConfiguration"
},
{
diff --git
a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
index aeb8078..aca5df5 100644
---
a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
+++
b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/csv/springboot/BindyCsvDataFormatConfiguration.java
@@ -33,8 +33,8 @@ public class BindyCsvDataFormatConfiguration
DataFormatConfigurationPropertiesCommon {
/**
- * Whether to enable auto configuration of the bindy-csv data format. This
- * is enabled by default.
+ * Whether to enable auto configuration of the bindyCsv data format. This
is
+ * enabled by default.
*/
private Boolean enabled;
/**
diff --git
a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
index 3e64519..0f66660 100644
---
a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
+++
b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/fixed/springboot/BindyFixedLengthDataFormatConfiguration.java
@@ -33,7 +33,7 @@ public class BindyFixedLengthDataFormatConfiguration
DataFormatConfigurationPropertiesCommon {
/**
- * Whether to enable auto configuration of the bindy-fixed data format.
This
+ * Whether to enable auto configuration of the bindyFixed data format. This
* is enabled by default.
*/
private Boolean enabled;
diff --git
a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
index 59e7167..e315174 100644
---
a/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
+++
b/components-starter/camel-bindy-starter/src/main/java/org/apache/camel/dataformat/bindy/kvp/springboot/BindyKeyValuePairDataFormatConfiguration.java
@@ -33,8 +33,8 @@ public class BindyKeyValuePairDataFormatConfiguration
DataFormatConfigurationPropertiesCommon {
/**
- * Whether to enable auto configuration of the bindy-kvp data format. This
- * is enabled by default.
+ * Whether to enable auto configuration of the bindyKvp data format. This
is
+ * enabled by default.
*/
private Boolean enabled;
/**
diff --git
a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelBindyTest.java
b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelBindyTest.java
index 7884eaf..9b07c8f 100644
---
a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelBindyTest.java
+++
b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelBindyTest.java
@@ -40,9 +40,9 @@ public class CamelBindyTest extends
AbstractSpringBootTestSupport {
@Test
public void componentTests() throws Exception {
- this.runDataformatTest(config, "bindy-csv");
- this.runDataformatTest(config, "bindy-fixed");
- this.runDataformatTest(config, "bindy-kvp");
+ this.runDataformatTest(config, "bindyCsv");
+ this.runDataformatTest(config, "bindyFixed");
+ this.runDataformatTest(config, "bindyKvp");
this.runModuleUnitTestsIfEnabled(config);
}
diff --git
a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
index c109f82..0f22081 100644
---
a/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
+++
b/tooling/camel-spring-boot-generator-maven-plugin/src/main/java/org/apache/camel/springboot/maven/SpringBootAutoConfigurationMojo.java
@@ -73,6 +73,8 @@ import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
+import static org.apache.camel.tooling.util.Strings.camelCaseToDash;
+
/**
* Generate Spring Boot auto configuration files for Camel components and data
* formats.
@@ -678,7 +680,7 @@ public class SpringBootAutoConfigurationMojo extends
AbstractSpringBootGenerator
}
javaClass.getJavaDoc().setText(doc);
- String prefix = "camel.component." + (overrideComponentName != null ?
overrideComponentName : model.getScheme());
+ String prefix = "camel.component." +
camelCaseToDash(overrideComponentName != null ? overrideComponentName :
model.getScheme());
// make sure prefix is in lower case
prefix = prefix.toLowerCase(Locale.US);
javaClass.addAnnotation(Generated.class.getName()).setStringValue("value",
SpringBootAutoConfigurationMojo.class.getName());
@@ -1054,7 +1056,7 @@ public class SpringBootAutoConfigurationMojo extends
AbstractSpringBootGenerator
}
javaClass.getJavaDoc().setFullText(doc);
- String prefix = "camel.dataformat." + (overrideDataFormatName != null
? overrideDataFormatName : model.getName());
+ String prefix = "camel.dataformat." +
camelCaseToDash(overrideDataFormatName != null ? overrideDataFormatName :
model.getName());
// make sure prefix is in lower case
prefix = prefix.toLowerCase(Locale.US);
javaClass.addAnnotation(Generated.class).setStringValue("value",
SpringBootAutoConfigurationMojo.class.getName());
@@ -1158,7 +1160,7 @@ public class SpringBootAutoConfigurationMojo extends
AbstractSpringBootGenerator
}
javaClass.getJavaDoc().setFullText(doc);
- String prefix = "camel.language." + (overrideLanguageName != null ?
overrideLanguageName : model.getName());
+ String prefix = "camel.language." +
(camelCaseToDash(overrideLanguageName != null ? overrideLanguageName :
model.getName()));
// make sure prefix is in lower case
prefix = prefix.toLowerCase(Locale.US);
javaClass.addAnnotation(Generated.class).setStringValue("value",
SpringBootAutoConfigurationMojo.class.getName());
@@ -1268,7 +1270,7 @@ public class SpringBootAutoConfigurationMojo extends
AbstractSpringBootGenerator
final String name =
model.getJavaType().substring(model.getJavaType().lastIndexOf(".") +
1).replace("Component", "ComponentAutoConfiguration");
final String configurationName =
name.replace("ComponentAutoConfiguration", "ComponentConfiguration");
- final String componentName = (overrideName != null ? overrideName :
model.getScheme()).toLowerCase(Locale.US);
+ final String componentName = camelCaseToDash(overrideName != null ?
overrideName : model.getScheme()).toLowerCase(Locale.US);
final Class<?> configClass = generateDummyClass(packageName + "." +
configurationName);
JavaClass javaClass = new JavaClass(getProjectClassLoader());
@@ -1478,7 +1480,7 @@ public class SpringBootAutoConfigurationMojo extends
AbstractSpringBootGenerator
final String name =
model.getJavaType().substring(model.getJavaType().lastIndexOf(".") +
1).replace("DataFormat", "DataFormatAutoConfiguration");
final String configurationName =
name.replace("DataFormatAutoConfiguration", "DataFormatConfiguration");
- final String dataformatName = (overrideName != null ? overrideName :
model.getName()).toLowerCase(Locale.US);
+ final String dataformatName = camelCaseToDash(overrideName != null ?
overrideName : model.getName()).toLowerCase(Locale.US);
final Class<?> configClass = generateDummyClass(packageName + "." +
configurationName);
final JavaClass javaClass = new JavaClass(getProjectClassLoader());
@@ -1576,7 +1578,7 @@ public class SpringBootAutoConfigurationMojo extends
AbstractSpringBootGenerator
final String name =
model.getJavaType().substring(model.getJavaType().lastIndexOf(".") +
1).replace("Language", "LanguageAutoConfiguration");
final String configurationName =
name.replace("LanguageAutoConfiguration", "LanguageConfiguration");
- final String languageName = (overrideName != null ? overrideName :
model.getName()).toLowerCase(Locale.US);
+ final String languageName = camelCaseToDash(overrideName != null ?
overrideName : model.getName()).toLowerCase(Locale.US);
final Class<?> configClass = generateDummyClass(packageName + "." +
configurationName);
final JavaClass javaClass = new JavaClass(getProjectClassLoader());