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/08 14:34:10 UTC
[camel] 05/09: CAMEL-17763: cleanup unused exceptions in camel-facebook
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 1f1e2251ea7d503ca25078f2ea0fa8036f04fa01
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Fri Apr 8 15:27:45 2022 +0200
CAMEL-17763: cleanup unused exceptions in camel-facebook
---
.../camel/component/facebook/CamelFacebookTestSupport.java | 2 +-
.../camel/component/facebook/FacebookComponentConsumerIT.java | 8 ++++----
.../component/facebook/FacebookComponentPageIdProducerIT.java | 2 +-
.../camel/component/facebook/FacebookComponentProducerIT.java | 6 +++---
.../apache/camel/component/facebook/FacebookEndpointIT.java | 6 +++---
.../org/apache/camel/component/facebook/TestUserMethodsIT.java | 6 +++---
.../facebook/config/FacebookEndpointConfigurationTest.java | 2 +-
.../component/facebook/data/FacebookMethodsTypeHelperTest.java | 10 +++++-----
.../camel/component/facebook/data/FacebookMethodsTypeTest.java | 2 +-
9 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
index 6d1ec19eb1f..a05f5158ed2 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/CamelFacebookTestSupport.java
@@ -34,7 +34,7 @@ public abstract class CamelFacebookTestSupport extends CamelTestSupport {
protected Properties properties;
protected FacebookConfiguration configuration;
- protected void loadProperties(CamelContext context) throws Exception {
+ protected void loadProperties(CamelContext context) {
loadProperties();
Map<String, Object> options = new HashMap<>();
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerIT.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerIT.java
index 6471f986583..ea47aa5c1e7 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerIT.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentConsumerIT.java
@@ -48,7 +48,7 @@ public class FacebookComponentConsumerIT extends CamelFacebookTestSupport {
private final Set<String> searchNames = new HashSet<>();
private List<String> excludedNames;
- public FacebookComponentConsumerIT() throws Exception {
+ public FacebookComponentConsumerIT() {
// find search methods for consumer tests
for (Method method : SearchMethods.class.getDeclaredMethods()) {
String name = getShortName(method.getName());
@@ -95,7 +95,7 @@ public class FacebookComponentConsumerIT extends CamelFacebookTestSupport {
}
@Override
- protected void doPostSetup() throws Exception {
+ protected void doPostSetup() {
ignoreDeprecatedApiError();
}
@@ -124,9 +124,9 @@ public class FacebookComponentConsumerIT extends CamelFacebookTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
- public void configure() throws Exception {
+ public void configure() {
// start with a 30 day window for the first delayed poll
String since = "RAW(" + new SimpleDateFormat(FacebookConstants.FACEBOOK_DATE_FORMAT).format(
new Date(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(30, TimeUnit.DAYS))) + ")";
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentPageIdProducerIT.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentPageIdProducerIT.java
index 2b8267c5da7..19612fe5528 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentPageIdProducerIT.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentPageIdProducerIT.java
@@ -38,7 +38,7 @@ public class FacebookComponentPageIdProducerIT extends CamelFacebookTestSupport
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
from("timer:period=20000")
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerIT.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerIT.java
index 2f93c32875f..43a7a34ed4f 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerIT.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookComponentProducerIT.java
@@ -46,7 +46,7 @@ public class FacebookComponentProducerIT extends CamelFacebookTestSupport {
private final List<String> idExcludes;
private final List<String> readingExcludes;
- public FacebookComponentProducerIT() throws Exception {
+ public FacebookComponentProducerIT() {
for (Class<?> clazz : Facebook.class.getInterfaces()) {
final String clazzName = clazz.getSimpleName();
if (clazzName.endsWith("Methods") && !clazzName.equals("GameMethods")) {
@@ -118,14 +118,14 @@ public class FacebookComponentProducerIT extends CamelFacebookTestSupport {
}
@Test
- public void testJsonStoreEnabled() throws Exception {
+ public void testJsonStoreEnabled() {
final String rawJSON = template().requestBody("direct://testJsonStoreEnabled", new String[] { "me" }, String.class);
assertNotNull("NULL rawJSON", rawJSON);
assertFalse(rawJSON.isEmpty(), "Empty rawJSON");
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
// Deprecated exceptions are ignored in the tests since this depends on the
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookEndpointIT.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookEndpointIT.java
index 0c06e62755c..1c300f391a3 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookEndpointIT.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/FacebookEndpointIT.java
@@ -29,7 +29,7 @@ import org.junit.jupiter.api.condition.EnabledIf;
disabledReason = "Facebook credentials were not provided")
public class FacebookEndpointIT extends CamelFacebookTestSupport {
- public FacebookEndpointIT() throws Exception {
+ public FacebookEndpointIT() {
}
@Test
@@ -53,10 +53,10 @@ public class FacebookEndpointIT extends CamelFacebookTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
- public void configure() throws Exception {
+ public void configure() {
from("direct:testNoArgs")
.to("facebook:getuserlikes")
.to("mock://testNoArgs");
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/TestUserMethodsIT.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/TestUserMethodsIT.java
index aa232119c1f..d5b468339e8 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/TestUserMethodsIT.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/TestUserMethodsIT.java
@@ -40,7 +40,7 @@ public class TestUserMethodsIT extends CamelFacebookTestSupport {
private static final String TEST_USER1 = "test one";
private static final String TEST_USER2 = "test two";
- public TestUserMethodsIT() throws Exception {
+ public TestUserMethodsIT() {
}
@Test
@@ -77,10 +77,10 @@ public class TestUserMethodsIT extends CamelFacebookTestSupport {
}
@Override
- protected RouteBuilder createRouteBuilder() throws Exception {
+ protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
@Override
- public void configure() throws Exception {
+ public void configure() {
from("direct:createTestUser")
.to("facebook://createTestUser?inBody=name&appId=" + properties.get("oAuthAppId")
+ "&userLocale=" + Locale.getDefault().toString()
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/config/FacebookEndpointConfigurationTest.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/config/FacebookEndpointConfigurationTest.java
index 1803d7c3fd6..318aecd0c57 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/config/FacebookEndpointConfigurationTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/config/FacebookEndpointConfigurationTest.java
@@ -38,7 +38,7 @@ public class FacebookEndpointConfigurationTest extends CamelTestSupport {
}
@BindToRegistry("configuration")
- public FacebookEndpointConfiguration createConf() throws Exception {
+ public FacebookEndpointConfiguration createConf() {
FacebookEndpointConfiguration facebookEndpointConfiguration = new FacebookEndpointConfiguration();
facebookEndpointConfiguration.setOAuthAppId("fakeId");
facebookEndpointConfiguration.setOAuthAppSecret("fakeSecret");
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
index c87f4f5a329..99e8033f2e7 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeHelperTest.java
@@ -51,7 +51,7 @@ public class FacebookMethodsTypeHelperTest {
}
@Test
- public void testGetCandidateMethods() throws Exception {
+ public void testGetCandidateMethods() {
for (FacebookMethodsType method : FacebookMethodsType.values()) {
final String name = method.getName();
final String shortName = getShortName(method.getName());
@@ -72,7 +72,7 @@ public class FacebookMethodsTypeHelperTest {
}
@Test
- public void testGetArguments() throws Exception {
+ public void testGetArguments() {
final Class<?>[] interfaces = Facebook.class.getInterfaces();
for (Class<?> clazz : interfaces) {
if (clazz.getName().endsWith("Methods")) {
@@ -93,7 +93,7 @@ public class FacebookMethodsTypeHelperTest {
}
@Test
- public void testAllArguments() throws Exception {
+ public void testAllArguments() {
assertFalse(FacebookMethodsTypeHelper.allArguments().isEmpty(), "Missing arguments");
}
@@ -118,13 +118,13 @@ public class FacebookMethodsTypeHelperTest {
}
@Test
- public void testConvertToGetMethod() throws Exception {
+ public void testConvertToGetMethod() {
assertEquals(FacebookMethodsType.GET_ACCOUNTS.getName(), FacebookMethodsTypeHelper.convertToGetMethod("accounts"),
"Invalid get method name");
}
@Test
- public void testConvertToSearchMethod() throws Exception {
+ public void testConvertToSearchMethod() {
assertEquals(FacebookMethodsType.SEARCHPOSTS.getName(), FacebookMethodsTypeHelper.convertToSearchMethod("posts"),
"Invalid search method name");
}
diff --git a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
index f52e094a7da..345502abc1d 100644
--- a/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
+++ b/components/camel-facebook/src/test/java/org/apache/camel/component/facebook/data/FacebookMethodsTypeTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
public class FacebookMethodsTypeTest {
@Test
- public void areAllMethodsMapped() throws Exception {
+ public void areAllMethodsMapped() {
final Class<?>[] interfaces = Facebook.class.getInterfaces();
for (Class<?> clazz : interfaces) {
if (clazz.getName().endsWith("Methods")) {