From aa08a5cc575e5228c267686ba668cdbb3f361a90 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 7 Jun 2016 15:05:11 +0200 Subject: [PATCH] Refactoring: moved all code concerned with error-handling in one package --- .../java/de/juplo/facebook/FacebookUtils.java | 2 +- .../GraphApiErrorHandler.java | 4 ++-- .../GraphApiErrorHandlerTest.java | 19 ++++++------------- .../MockClientHttpRequestFactory.java | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) rename src/main/java/de/juplo/facebook/{client => exceptions}/GraphApiErrorHandler.java (97%) rename src/test/java/de/juplo/facebook/{client => exceptions}/GraphApiErrorHandlerTest.java (96%) rename src/test/java/de/juplo/facebook/{client => exceptions}/MockClientHttpRequestFactory.java (98%) diff --git a/src/main/java/de/juplo/facebook/FacebookUtils.java b/src/main/java/de/juplo/facebook/FacebookUtils.java index b2b8261..1a76601 100644 --- a/src/main/java/de/juplo/facebook/FacebookUtils.java +++ b/src/main/java/de/juplo/facebook/FacebookUtils.java @@ -2,7 +2,7 @@ package de.juplo.facebook; import de.juplo.facebook.token.SignedRequestAwareAuthorizationCodeAccessTokenProvider; -import de.juplo.facebook.client.GraphApiErrorHandler; +import de.juplo.facebook.exceptions.GraphApiErrorHandler; import java.util.Arrays; import java.util.LinkedList; import java.util.List; diff --git a/src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java b/src/main/java/de/juplo/facebook/exceptions/GraphApiErrorHandler.java similarity index 97% rename from src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java rename to src/main/java/de/juplo/facebook/exceptions/GraphApiErrorHandler.java index 6b1ab97..974bf85 100644 --- a/src/main/java/de/juplo/facebook/client/GraphApiErrorHandler.java +++ b/src/main/java/de/juplo/facebook/exceptions/GraphApiErrorHandler.java @@ -1,6 +1,6 @@ -package de.juplo.facebook.client; +package de.juplo.facebook.exceptions; + -import de.juplo.facebook.exceptions.GraphApiException; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; diff --git a/src/test/java/de/juplo/facebook/client/GraphApiErrorHandlerTest.java b/src/test/java/de/juplo/facebook/exceptions/GraphApiErrorHandlerTest.java similarity index 96% rename from src/test/java/de/juplo/facebook/client/GraphApiErrorHandlerTest.java rename to src/test/java/de/juplo/facebook/exceptions/GraphApiErrorHandlerTest.java index c9921fa..86e1dfd 100644 --- a/src/test/java/de/juplo/facebook/client/GraphApiErrorHandlerTest.java +++ b/src/test/java/de/juplo/facebook/exceptions/GraphApiErrorHandlerTest.java @@ -1,20 +1,13 @@ -package de.juplo.facebook.client; - -import de.juplo.facebook.exceptions.AccessTokenRequiredException; -import de.juplo.facebook.exceptions.CallbackVerificationFailedException; -import de.juplo.facebook.exceptions.UnsupportedGetRequestException; -import de.juplo.facebook.exceptions.UnexpectedErrorException; -import de.juplo.facebook.exceptions.RateExceededException; -import de.juplo.facebook.exceptions.GraphApiException; +package de.juplo.facebook.exceptions; + import de.juplo.facebook.exceptions.GraphApiException.Type; -import de.juplo.facebook.exceptions.UnknownErrorException; -import de.juplo.facebook.exceptions.PageMigratedException; -import de.juplo.facebook.exceptions.UnmappedErrorException; import java.util.Date; import java.util.Map; import java.util.Set; import javax.annotation.Resource; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.fail; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -40,7 +33,7 @@ import org.springframework.web.client.HttpClientErrorException; /** * - * @author kai + * @author Kai Moritz */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration( diff --git a/src/test/java/de/juplo/facebook/client/MockClientHttpRequestFactory.java b/src/test/java/de/juplo/facebook/exceptions/MockClientHttpRequestFactory.java similarity index 98% rename from src/test/java/de/juplo/facebook/client/MockClientHttpRequestFactory.java rename to src/test/java/de/juplo/facebook/exceptions/MockClientHttpRequestFactory.java index 7fee109..34dc793 100644 --- a/src/test/java/de/juplo/facebook/client/MockClientHttpRequestFactory.java +++ b/src/test/java/de/juplo/facebook/exceptions/MockClientHttpRequestFactory.java @@ -1,4 +1,4 @@ -package de.juplo.facebook.client; +package de.juplo.facebook.exceptions; import java.io.ByteArrayInputStream; import java.io.IOException; -- 2.20.1