You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/04/13 08:18:59 UTC
[camel] 02/08: CAMEL-17763: cleaned up unused exceptions in camel-onlingo4
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2104db00ebec5a305b62b842f559844cb0843e5b
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Tue Apr 12 18:33:28 2022 +0200
CAMEL-17763: cleaned up unused exceptions in camel-onlingo4
---
.../apache/camel/component/olingo4/Olingo4AppAPITest.java | 8 +++-----
.../component/olingo4/AbstractOlingo4TestSupport.java | 3 +--
.../component/olingo4/Olingo4ComponentProducerTest.java | 14 +++++++-------
.../apache/camel/component/olingo4/Olingo4RouteTest.java | 4 ++--
4 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java b/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
index 215d5faf842..89db91a0735 100644
--- a/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
+++ b/components/camel-olingo4/camel-olingo4-api/src/test/java/org/apache/camel/component/olingo4/Olingo4AppAPITest.java
@@ -39,11 +39,9 @@ import org.apache.camel.component.olingo4.api.batch.Olingo4BatchRequest;
import org.apache.camel.component.olingo4.api.batch.Olingo4BatchResponse;
import org.apache.camel.component.olingo4.api.batch.Operation;
import org.apache.camel.component.olingo4.api.impl.Olingo4AppImpl;
-import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpResponseInterceptor;
-import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.entity.InputStreamEntity;
@@ -141,7 +139,7 @@ public class Olingo4AppAPITest {
}
@AfterAll
- public static void afterClass() throws Exception {
+ public static void afterClass() {
if (olingoApp != null) {
olingoApp.close();
}
@@ -168,7 +166,7 @@ public class Olingo4AppAPITest {
* generated postfix
*/
@SuppressWarnings("deprecation")
- protected static String getRealServiceUrl(String baseUrl) throws ClientProtocolException, IOException {
+ protected static String getRealServiceUrl(String baseUrl) throws IOException {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(baseUrl);
HttpContext httpContext = new BasicHttpContext();
@@ -601,7 +599,7 @@ public class Olingo4AppAPITest {
final HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
httpClientBuilder.addInterceptorFirst(new HttpResponseInterceptor() {
@Override
- public void process(HttpResponse response, HttpContext context) throws HttpException, IOException {
+ public void process(HttpResponse response, HttpContext context) throws IOException {
if (response.getStatusLine().getStatusCode() == HttpStatusCode.NO_CONTENT.getStatusCode()) {
try {
response.setEntity(new InputStreamEntity(
diff --git a/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/AbstractOlingo4TestSupport.java b/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/AbstractOlingo4TestSupport.java
index 9bcdfa2e0d2..725e2f904ec 100644
--- a/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/AbstractOlingo4TestSupport.java
+++ b/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/AbstractOlingo4TestSupport.java
@@ -23,7 +23,6 @@ import org.apache.camel.CamelContext;
import org.apache.camel.CamelExecutionException;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.apache.http.HttpHost;
-import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.CloseableHttpClient;
@@ -69,7 +68,7 @@ public class AbstractOlingo4TestSupport extends CamelTestSupport {
* generated postfix
*/
@SuppressWarnings("deprecation")
- protected String getRealServiceUrl(String baseUrl) throws ClientProtocolException, IOException {
+ protected String getRealServiceUrl(String baseUrl) throws IOException {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(baseUrl);
HttpContext httpContext = new BasicHttpContext();
diff --git a/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4ComponentProducerTest.java b/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4ComponentProducerTest.java
index 4947a473e7c..5713d87e499 100644
--- a/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4ComponentProducerTest.java
+++ b/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4ComponentProducerTest.java
@@ -87,7 +87,7 @@ public class Olingo4ComponentProducerTest extends AbstractOlingo4TestSupport {
}
@Test
- public void testRead() throws Exception {
+ public void testRead() {
final Map<String, Object> headers = new HashMap<>();
// Read metadata ($metadata) object
@@ -158,7 +158,7 @@ public class Olingo4ComponentProducerTest extends AbstractOlingo4TestSupport {
}
@Test
- public void testCreateUpdateDelete() throws Exception {
+ public void testCreateUpdateDelete() {
final ClientEntity clientEntity = createEntity();
ClientEntity entity = requestBody("direct:create-entity", clientEntity);
@@ -191,7 +191,7 @@ public class Olingo4ComponentProducerTest extends AbstractOlingo4TestSupport {
}
@Test
- public void testCreateUpdateDeleteFromJson() throws Exception {
+ public void testCreateUpdateDeleteFromJson() {
ClientEntity entity = requestBody("direct:create-entity", TEST_CREATE_JSON);
assertNotNull(entity);
assertEquals("Lewis", entity.getProperty("FirstName").getValue().toString());
@@ -234,7 +234,7 @@ public class Olingo4ComponentProducerTest extends AbstractOlingo4TestSupport {
}
@Test
- public void testBatch() throws Exception {
+ public void testBatch() {
final List<Olingo4BatchRequest> batchParts = new ArrayList<>();
// 1. Edm query
@@ -313,14 +313,14 @@ public class Olingo4ComponentProducerTest extends AbstractOlingo4TestSupport {
}
@Test
- public void testUnboundActionRequest() throws Exception {
+ public void testUnboundActionRequest() {
final HttpStatusCode status = requestBody("direct:unbound-action-ResetDataSource", null);
assertEquals(HttpStatusCode.NO_CONTENT.getStatusCode(), status.getStatusCode());
}
@Test
@Disabled
- public void testBoundActionRequest() throws Exception {
+ public void testBoundActionRequest() {
final ClientEntity clientEntity = objFactory.newEntity(null);
clientEntity.getProperties().add(
objFactory.newPrimitiveProperty("userName", objFactory.newPrimitiveValueBuilder().buildString("scottketchum")));
@@ -433,7 +433,7 @@ public class Olingo4ComponentProducerTest extends AbstractOlingo4TestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
// test routes for read
diff --git a/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4RouteTest.java b/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4RouteTest.java
index e958ec901a4..af9fcd1feb1 100644
--- a/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4RouteTest.java
+++ b/components/camel-olingo4/camel-olingo4-component/src/test/java/org/apache/camel/component/olingo4/Olingo4RouteTest.java
@@ -34,7 +34,7 @@ public class Olingo4RouteTest extends CamelTestSupport {
}
@Test
- public void testRead() throws Exception {
+ public void testRead() {
// Read entity set of the People object
final ClientEntitySet entities = (ClientEntitySet) requestBody("direct:readentities", null);
assertNotNull(entities);
@@ -42,7 +42,7 @@ public class Olingo4RouteTest extends CamelTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("direct:readentities").to("olingo4://read/People?serviceUri=" + TEST_SERVICE_BASE_URL);