This is an automated email from the ASF dual-hosted git repository.
aldettinger pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new c70be75497 geocoder: fix a few warnings
c70be75497 is described below
commit c70be754974ae807cf119346cc008e2ef19f0079
Author: aldettinger <[email protected]>
AuthorDate: Mon Jul 11 09:29:31 2022 +0200
geocoder: fix a few warnings
---
.../component/geocoder/it/GeocoderGoogleResource.java | 6 +++---
.../quarkus/component/geocoder/it/GeocoderProducers.java | 10 ++++++++--
.../camel/quarkus/component/geocoder/it/MockApiService.java | 13 ++++++++++---
3 files changed, 21 insertions(+), 8 deletions(-)
diff --git
a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderGoogleResource.java
b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderGoogleResource.java
index 6db21868d0..2e08ca767d 100644
---
a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderGoogleResource.java
+++
b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderGoogleResource.java
@@ -47,7 +47,7 @@ public class GeocoderGoogleResource {
final GeocodingResult[] response = producerTemplate.requestBody(
String.format("geocoder:address:current?apiKey=%s",
googleApiKey),
null, GeocodingResult[].class);
- LOG.infof("Response : %s", response);
+ LOG.infof("Response : %s", (Object[]) response);
return response;
}
@@ -58,7 +58,7 @@ public class GeocoderGoogleResource {
final GeocodingResult[] response = producerTemplate.requestBody(
String.format("geocoder:address:%s?apiKey=%s", address,
googleApiKey),
null, GeocodingResult[].class);
- LOG.infof("Response: %s", response);
+ LOG.infof("Response: %s", (Object[]) response);
return response;
}
@@ -69,7 +69,7 @@ public class GeocoderGoogleResource {
final GeocodingResult[] response = producerTemplate.requestBody(
String.format("geocoder:latlng:%s,%s?apiKey=%s", latitude,
longitude, googleApiKey),
null, GeocodingResult[].class);
- LOG.infof("Response : %s", response);
+ LOG.infof("Response : %s", (Object[]) response);
return response;
}
}
diff --git
a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderProducers.java
b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderProducers.java
index d628b5e37f..42f66a99df 100644
---
a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderProducers.java
+++
b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/GeocoderProducers.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.quarkus.component.geocoder.it;
+import java.lang.reflect.InvocationTargetException;
import java.util.Optional;
import javax.enterprise.context.ApplicationScoped;
@@ -37,13 +38,18 @@ public class GeocoderProducers {
* We need to implement some conditional configuration of the {@link
GeoCoderComponent} thus we create it
* programmatically and publish via CDI.
*
- * @return a configured {@link GeoCoderComponent}
+ * @return a configured {@link GeoCoderComponent}
+ * @throws SecurityException
+ * @throws NoSuchMethodException
+ * @throws InvocationTargetException
+ * @throws IllegalArgumentException
*/
@Produces
@ApplicationScoped
@Named("geocoder")
GeoCoderComponent geocoderComponent(CamelContext camelContext,
MockApiService mockApiService)
- throws IllegalAccessException, NoSuchFieldException,
InstantiationException {
+ throws IllegalAccessException, NoSuchFieldException,
InstantiationException, IllegalArgumentException,
+ InvocationTargetException, NoSuchMethodException,
SecurityException {
final Optional<String> wireMockUrl =
ConfigProvider.getConfig().getOptionalValue("wiremock.url", String.class);
final GeoCoderComponent result = new GeoCoderComponent();
result.setCamelContext(camelContext);
diff --git
a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java
b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java
index 2cd89c1c69..0c9e0a10a4 100644
---
a/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java
+++
b/integration-tests/geocoder/src/main/java/org/apache/camel/quarkus/component/geocoder/it/MockApiService.java
@@ -17,6 +17,7 @@
package org.apache.camel.quarkus.component.geocoder.it;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import javax.enterprise.context.ApplicationScoped;
@@ -28,7 +29,8 @@ import io.quarkus.runtime.annotations.RegisterForReflection;
public class MockApiService {
public GeoApiContext createGeoApiContext(String baseUri, String apiKey)
- throws IllegalAccessException, InstantiationException,
NoSuchFieldException {
+ throws IllegalAccessException, InstantiationException,
NoSuchFieldException, IllegalArgumentException,
+ InvocationTargetException, NoSuchMethodException,
SecurityException {
GeoApiContext.Builder builder = createGeoApiContext(baseUri);
builder.apiKey(apiKey);
return builder.build();
@@ -42,11 +44,16 @@ public class MockApiService {
* @throws IllegalAccessException
* @throws InstantiationException
* @throws NoSuchFieldException
+ * @throws SecurityException
+ * @throws NoSuchMethodException
+ * @throws InvocationTargetException
+ * @throws IllegalArgumentException
*/
public GeoApiContext.Builder createGeoApiContext(String baseUrl)
- throws IllegalAccessException, InstantiationException,
NoSuchFieldException {
+ throws IllegalAccessException, InstantiationException,
NoSuchFieldException, IllegalArgumentException,
+ InvocationTargetException, NoSuchMethodException,
SecurityException {
Class<?> clazz = GeoApiContext.Builder.class;
- Object builder = clazz.newInstance();
+ Object builder = clazz.getDeclaredConstructor().newInstance();
Field f1 = builder.getClass().getDeclaredField("baseUrlOverride");
f1.setAccessible(true);