killbill-memoizeit

server: reformat TestJaxrsBase No functional change. Signed-off-by:

6/14/2012 8:48:48 PM

Details

diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
index 4c4c0c9..f9a4060 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
@@ -15,13 +15,12 @@
  */
 package com.ning.billing.jaxrs;
 
-import static org.testng.Assert.assertNotNull;
-
+import javax.annotation.Nullable;
+import javax.ws.rs.core.Response.Status;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.EventListener;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -31,17 +30,6 @@ import java.util.Map.Entry;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
-import javax.annotation.Nullable;
-import javax.ws.rs.core.Response.Status;
-
-import com.google.common.io.Resources;
-import com.ning.billing.invoice.api.InvoiceNotifier;
-import com.ning.billing.invoice.notification.EmailInvoiceNotifier;
-import com.ning.billing.invoice.notification.NullInvoiceNotifier;
-import com.ning.billing.jaxrs.resources.JaxrsResource;
-import com.ning.billing.util.email.EmailModule;
-import com.ning.billing.util.email.templates.TemplateModule;
-import com.ning.billing.util.glue.GlobalLockerModule;
 import org.apache.commons.io.IOUtils;
 import org.eclipse.jetty.servlet.FilterHolder;
 import org.skife.config.ConfigurationObjectFactory;
@@ -58,7 +46,7 @@ import org.testng.annotations.BeforeSuite;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.datatype.joda.JodaModule;
-
+import com.google.common.io.Resources;
 import com.google.inject.Module;
 import com.ning.billing.account.glue.AccountModule;
 import com.ning.billing.analytics.setup.AnalyticsModule;
@@ -72,13 +60,16 @@ import com.ning.billing.dbi.DBIProvider;
 import com.ning.billing.dbi.DbiConfig;
 import com.ning.billing.dbi.MysqlTestingHelper;
 import com.ning.billing.entitlement.glue.DefaultEntitlementModule;
+import com.ning.billing.invoice.api.InvoiceNotifier;
 import com.ning.billing.invoice.glue.DefaultInvoiceModule;
+import com.ning.billing.invoice.notification.NullInvoiceNotifier;
 import com.ning.billing.jaxrs.json.AccountJson;
 import com.ning.billing.jaxrs.json.BundleJsonNoSubscriptions;
 import com.ning.billing.jaxrs.json.PaymentMethodJson;
 import com.ning.billing.jaxrs.json.PaymentMethodJson.PaymentMethodPluginDetailJson;
 import com.ning.billing.jaxrs.json.PaymentMethodJson.PaymentMethodProperties;
 import com.ning.billing.jaxrs.json.SubscriptionJsonNoEvents;
+import com.ning.billing.jaxrs.resources.JaxrsResource;
 import com.ning.billing.junction.glue.DefaultJunctionModule;
 import com.ning.billing.payment.glue.PaymentModule;
 import com.ning.billing.payment.provider.MockPaymentProviderPluginModule;
@@ -86,9 +77,12 @@ import com.ning.billing.server.listeners.KillbillGuiceListener;
 import com.ning.billing.server.modules.KillbillServerModule;
 import com.ning.billing.util.clock.Clock;
 import com.ning.billing.util.clock.ClockMock;
+import com.ning.billing.util.email.EmailModule;
+import com.ning.billing.util.email.templates.TemplateModule;
 import com.ning.billing.util.glue.BusModule;
 import com.ning.billing.util.glue.CallContextModule;
 import com.ning.billing.util.glue.CustomFieldModule;
+import com.ning.billing.util.glue.GlobalLockerModule;
 import com.ning.billing.util.glue.NotificationQueueModule;
 import com.ning.billing.util.glue.TagStoreModule;
 import com.ning.http.client.AsyncCompletionHandler;
@@ -100,12 +94,13 @@ import com.ning.http.client.Response;
 import com.ning.jetty.core.CoreConfig;
 import com.ning.jetty.core.server.HttpServer;
 
-public class TestJaxrsBase {
+import static org.testng.Assert.assertNotNull;
 
-    protected final static String PLUGIN_NAME = "noop";
+public class TestJaxrsBase {
+    protected static final String PLUGIN_NAME = "noop";
 
     // STEPH
-    protected static final int DEFAULT_HTTP_TIMEOUT_SEC =  6000; // 5;
+    protected static final int DEFAULT_HTTP_TIMEOUT_SEC = 6000; // 5;
 
     protected static final Map<String, String> DEFAULT_EMPTY_QUERY = new HashMap<String, String>();
 
@@ -150,7 +145,6 @@ public class TestJaxrsBase {
     }
 
     public static class TestKillbillGuiceListener extends KillbillGuiceListener {
-
         private final MysqlTestingHelper helper;
         private final Clock clock;
 
@@ -159,6 +153,7 @@ public class TestJaxrsBase {
             this.helper = helper;
             this.clock = clock;
         }
+
         @Override
         protected Module getModule() {
             return new TestKillbillServerModule(helper, clock);
@@ -186,7 +181,6 @@ public class TestJaxrsBase {
     }
 
     public static class TestKillbillServerModule extends KillbillServerModule {
-
         private final MysqlTestingHelper helper;
         private final Clock clock;
 
@@ -201,15 +195,14 @@ public class TestJaxrsBase {
             bind(Clock.class).toInstance(clock);
         }
 
-
         private static final class PaymentMockModule extends PaymentModule {
             @Override
-            protected void installPaymentProviderPlugins(PaymentConfig config) {
+            protected void installPaymentProviderPlugins(final PaymentConfig config) {
                 install(new MockPaymentProviderPluginModule(PLUGIN_NAME));
             }
         }
 
-        protected void installKillbillModules(){
+        protected void installKillbillModules() {
 
             /*
              * For a lack of getting module override working, copy all install modules from parent class...
@@ -267,7 +260,7 @@ public class TestJaxrsBase {
         log.info("***************************************************************************************************");
     }
 
-    @BeforeClass(groups="slow")
+    @BeforeClass(groups = "slow")
     public void setupClass() throws IOException {
         loadConfig();
         httpClient = new AsyncHttpClient(new AsyncHttpClientConfig.Builder().setRequestTimeoutInMs(DEFAULT_HTTP_TIMEOUT_SEC * 1000).build());
@@ -279,17 +272,17 @@ public class TestJaxrsBase {
 
         busHandler = new TestApiListener(null);
         this.helper = listener.getMysqlTestingHelper();
-        this.clock =  (ClockMock) listener.getClock();
+        this.clock = (ClockMock) listener.getClock();
     }
-    
+
     private void setupMySQL() throws IOException {
         final String accountDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/account/ddl.sql"));
         final String entitlementDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/entitlement/ddl.sql"));
         final String invoiceDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/invoice/ddl.sql"));
         final String paymentDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/payment/ddl.sql"));
         final String utilDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/util/ddl.sql"));
-        final String analyticsDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/analytics/ddl.sql"));        
-        final String junctionDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/junction/ddl.sql"));        
+        final String analyticsDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/analytics/ddl.sql"));
+        final String junctionDdl = IOUtils.toString(TestIntegration.class.getResourceAsStream("/com/ning/billing/junction/ddl.sql"));
 
         helper.startMysql();
 
@@ -298,10 +291,9 @@ public class TestJaxrsBase {
         helper.initDb(invoiceDdl);
         helper.initDb(paymentDdl);
         helper.initDb(utilDdl);
-        helper.initDb(analyticsDdl);        
-        helper.initDb(junctionDdl);        
-   }
-
+        helper.initDb(analyticsDdl);
+        helper.initDb(junctionDdl);
+    }
 
     private void loadConfig() {
         if (config == null) {
@@ -309,12 +301,12 @@ public class TestJaxrsBase {
         }
     }
 
-    @BeforeSuite(groups="slow")
+    @BeforeSuite(groups = "slow")
     public void setup() throws Exception {
 
         loadSystemPropertiesFromClasspath("/killbill.properties");
         loadConfig();
-        
+
         this.helper = new MysqlTestingHelper();
         this.clock = new ClockMock();
         listener = new TestKillbillGuiceListener(helper, clock);
@@ -323,7 +315,7 @@ public class TestJaxrsBase {
         final Iterable<EventListener> eventListeners = new Iterable<EventListener>() {
             @Override
             public Iterator<EventListener> iterator() {
-                ArrayList<EventListener> array = new ArrayList<EventListener>();
+                final ArrayList<EventListener> array = new ArrayList<EventListener>();
                 array.add(listener);
                 return array.iterator();
             }
@@ -336,82 +328,81 @@ public class TestJaxrsBase {
         server.start();
     }
 
-    @AfterSuite(groups="slow")
+    @AfterSuite(groups = "slow")
     public void tearDown() {
         try {
             server.stop();
-        } catch (Exception e) {
-
+        } catch (Exception ignored) {
         }
+
         if (helper != null) {
             helper.stopMysql();
         }
     }
 
-    
     protected List<PaymentMethodProperties> getPaymentMethodCCProperties() {
-        List<PaymentMethodProperties> properties = new ArrayList<PaymentMethodJson.PaymentMethodProperties>();
+        final List<PaymentMethodProperties> properties = new ArrayList<PaymentMethodJson.PaymentMethodProperties>();
         properties.add(new PaymentMethodProperties("type", "CreditCard", false));
         properties.add(new PaymentMethodProperties("cardType", "Visa", false));
         properties.add(new PaymentMethodProperties("cardHolderName", "Mr Sniff", false));
-        properties.add(new PaymentMethodProperties("expirationDate", "2015-08", false));        
+        properties.add(new PaymentMethodProperties("expirationDate", "2015-08", false));
         properties.add(new PaymentMethodProperties("maskNumber", "3451", false));
         properties.add(new PaymentMethodProperties("address1", "23, rue des cerisiers", false));
         properties.add(new PaymentMethodProperties("address2", "", false));
-        properties.add(new PaymentMethodProperties("city", "Toulouse", false));        
+        properties.add(new PaymentMethodProperties("city", "Toulouse", false));
         properties.add(new PaymentMethodProperties("country", "France", false));
         properties.add(new PaymentMethodProperties("postalCode", "31320", false));
         properties.add(new PaymentMethodProperties("state", "Midi-Pyrenees", false));
         return properties;
     }
-    
-    
-  protected List<PaymentMethodProperties> getPaymentMethodPaypalProperties() {
-        List<PaymentMethodProperties> properties = new ArrayList<PaymentMethodJson.PaymentMethodProperties>();
+
+
+    protected List<PaymentMethodProperties> getPaymentMethodPaypalProperties() {
+        final List<PaymentMethodProperties> properties = new ArrayList<PaymentMethodJson.PaymentMethodProperties>();
         properties.add(new PaymentMethodProperties("type", "CreditCard", false));
         properties.add(new PaymentMethodProperties("email", "zouzou@laposte.fr", false));
         properties.add(new PaymentMethodProperties("baid", "23-8787d-R", false));
         return properties;
     }
-    
-    
-    protected PaymentMethodJson getPaymentMethodJson(String accountId, List<PaymentMethodProperties> properties) {
-        PaymentMethodPluginDetailJson info = new PaymentMethodPluginDetailJson(null, properties);
+
+
+    protected PaymentMethodJson getPaymentMethodJson(final String accountId, final List<PaymentMethodProperties> properties) {
+        final PaymentMethodPluginDetailJson info = new PaymentMethodPluginDetailJson(null, properties);
         return new PaymentMethodJson(null, accountId, true, PLUGIN_NAME, info);
     }
-    
-    protected AccountJson createAccountWithDefaultPaymentMethod(String name, String key, String email) throws Exception {
-        
-        AccountJson input = createAccount(name, key, email);
-        
+
+    protected AccountJson createAccountWithDefaultPaymentMethod(final String name, final String key, final String email) throws Exception {
+
+        final AccountJson input = createAccount(name, key, email);
+
         final String uri = JaxrsResource.ACCOUNTS_PATH + "/" + input.getAccountId() + "/" + JaxrsResource.PAYMENT_METHODS;
-        PaymentMethodJson paymentMethodJson = getPaymentMethodJson(input.getAccountId(), null);
+        final PaymentMethodJson paymentMethodJson = getPaymentMethodJson(input.getAccountId(), null);
         String baseJson = mapper.writeValueAsString(paymentMethodJson);
         Map<String, String> queryParams = new HashMap<String, String>();
         queryParams.put(JaxrsResource.QUERY_PAYMENT_METHOD_IS_DEFAULT, "true");
-        
+
         Response response = doPost(uri, baseJson, queryParams, DEFAULT_HTTP_TIMEOUT_SEC);
         Assert.assertEquals(response.getStatusCode(), Status.CREATED.getStatusCode());
 
-        
+
         queryParams = new HashMap<String, String>();
         queryParams.put(JaxrsResource.QUERY_EXTERNAL_KEY, input.getExternalKey());
         response = doGet(JaxrsResource.ACCOUNTS_PATH, queryParams, DEFAULT_HTTP_TIMEOUT_SEC);
         Assert.assertEquals(response.getStatusCode(), Status.OK.getStatusCode());
         baseJson = response.getResponseBody();
-        AccountJson objFromJson = mapper.readValue(baseJson, AccountJson.class);
+        final AccountJson objFromJson = mapper.readValue(baseJson, AccountJson.class);
         Assert.assertNotNull(objFromJson);
         Assert.assertNotNull(objFromJson.getPaymentMethodId());
         return objFromJson;
     }
-    
-    protected AccountJson createAccount(String name, String key, String email) throws Exception {
-        AccountJson input = getAccountJson(name, key, email);
+
+    protected AccountJson createAccount(final String name, final String key, final String email) throws Exception {
+        final AccountJson input = getAccountJson(name, key, email);
         String baseJson = mapper.writeValueAsString(input);
         Response response = doPost(JaxrsResource.ACCOUNTS_PATH, baseJson, DEFAULT_EMPTY_QUERY, DEFAULT_HTTP_TIMEOUT_SEC);
         Assert.assertEquals(response.getStatusCode(), Status.CREATED.getStatusCode());
 
-        String location = response.getHeader("Location");
+        final String location = response.getHeader("Location");
         Assert.assertNotNull(location);
 
         // Retrieves by Id based on Location returned
@@ -419,20 +410,19 @@ public class TestJaxrsBase {
         Assert.assertEquals(response.getStatusCode(), Status.OK.getStatusCode());
 
         baseJson = response.getResponseBody();
-        AccountJson objFromJson = mapper.readValue(baseJson, AccountJson.class);
+        final AccountJson objFromJson = mapper.readValue(baseJson, AccountJson.class);
         Assert.assertNotNull(objFromJson);
         return objFromJson;
     }
 
 
-
-    protected BundleJsonNoSubscriptions createBundle(String accountId, String key) throws Exception {
-        BundleJsonNoSubscriptions input = new BundleJsonNoSubscriptions(null, accountId, key, null);
+    protected BundleJsonNoSubscriptions createBundle(final String accountId, final String key) throws Exception {
+        final BundleJsonNoSubscriptions input = new BundleJsonNoSubscriptions(null, accountId, key, null);
         String baseJson = mapper.writeValueAsString(input);
         Response response = doPost(JaxrsResource.BUNDLES_PATH, baseJson, DEFAULT_EMPTY_QUERY, DEFAULT_HTTP_TIMEOUT_SEC);
         Assert.assertEquals(response.getStatusCode(), Status.CREATED.getStatusCode());
 
-        String location = response.getHeader("Location");
+        final String location = response.getHeader("Location");
         Assert.assertNotNull(location);
 
         // Retrieves by Id based on Location returned
@@ -440,22 +430,22 @@ public class TestJaxrsBase {
         Assert.assertEquals(response.getStatusCode(), Status.OK.getStatusCode());
 
         baseJson = response.getResponseBody();
-        BundleJsonNoSubscriptions objFromJson = mapper.readValue(baseJson, BundleJsonNoSubscriptions.class);
+        final BundleJsonNoSubscriptions objFromJson = mapper.readValue(baseJson, BundleJsonNoSubscriptions.class);
         Assert.assertTrue(objFromJson.equalsNoId(input));
         return objFromJson;
     }
 
     protected SubscriptionJsonNoEvents createSubscription(final String bundleId, final String productName, final String productCategory, final String billingPeriod, final boolean waitCompletion) throws Exception {
 
-        SubscriptionJsonNoEvents input = new SubscriptionJsonNoEvents(null, bundleId, null, productName, productCategory, billingPeriod, PriceListSet.DEFAULT_PRICELIST_NAME, null);
+        final SubscriptionJsonNoEvents input = new SubscriptionJsonNoEvents(null, bundleId, null, productName, productCategory, billingPeriod, PriceListSet.DEFAULT_PRICELIST_NAME, null);
         String baseJson = mapper.writeValueAsString(input);
 
 
-        Map<String, String> queryParams = waitCompletion ? getQueryParamsForCallCompletion("5") : DEFAULT_EMPTY_QUERY;
+        final Map<String, String> queryParams = waitCompletion ? getQueryParamsForCallCompletion("5") : DEFAULT_EMPTY_QUERY;
         Response response = doPost(JaxrsResource.SUBSCRIPTIONS_PATH, baseJson, queryParams, DEFAULT_HTTP_TIMEOUT_SEC);
         Assert.assertEquals(response.getStatusCode(), Status.CREATED.getStatusCode());
 
-        String location = response.getHeader("Location");
+        final String location = response.getHeader("Location");
         Assert.assertNotNull(location);
 
         // Retrieves by Id based on Location returned
@@ -464,13 +454,13 @@ public class TestJaxrsBase {
         Assert.assertEquals(response.getStatusCode(), Status.OK.getStatusCode());
 
         baseJson = response.getResponseBody();
-        SubscriptionJsonNoEvents objFromJson = mapper.readValue(baseJson, SubscriptionJsonNoEvents.class);
+        final SubscriptionJsonNoEvents objFromJson = mapper.readValue(baseJson, SubscriptionJsonNoEvents.class);
         Assert.assertTrue(objFromJson.equalsNoSubscriptionIdNoStartDateNoCTD(input));
         return objFromJson;
     }
 
     protected Map<String, String> getQueryParamsForCallCompletion(final String timeoutSec) {
-        Map<String, String> queryParams = new HashMap<String, String>();
+        final Map<String, String> queryParams = new HashMap<String, String>();
         queryParams.put(JaxrsResource.QUERY_CALL_COMPLETION, "true");
         queryParams.put(JaxrsResource.QUERY_CALL_TIMEOUT, timeoutSec);
         return queryParams;
@@ -480,7 +470,7 @@ public class TestJaxrsBase {
     // HTTP CLIENT HELPERS
     //
     protected Response doPost(final String uri, @Nullable final String body, final Map<String, String> queryParams, final int timeoutSec) {
-        BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("POST", getUrlFromUri(uri), queryParams);
+        final BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("POST", getUrlFromUri(uri), queryParams);
         if (body != null) {
             builder.setBody(body);
         } else {
@@ -491,7 +481,7 @@ public class TestJaxrsBase {
 
     protected Response doPut(final String uri, final String body, final Map<String, String> queryParams, final int timeoutSec) {
         final String url = String.format("http://%s:%d%s", config.getServerHost(), config.getServerPort(), uri);
-        BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("PUT", url, queryParams);
+        final BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("PUT", url, queryParams);
         if (body != null) {
             builder.setBody(body);
         } else {
@@ -502,7 +492,7 @@ public class TestJaxrsBase {
 
     protected Response doDelete(final String uri, final Map<String, String> queryParams, final int timeoutSec) {
         final String url = String.format("http://%s:%d%s", config.getServerHost(), config.getServerPort(), uri);
-        BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("DELETE", url, queryParams);
+        final BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("DELETE", url, queryParams);
         return executeAndWait(builder, timeoutSec, true);
     }
 
@@ -512,30 +502,30 @@ public class TestJaxrsBase {
     }
 
     protected Response doGetWithUrl(final String url, final Map<String, String> queryParams, final int timeoutSec) {
-        BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("GET", url, queryParams);
+        final BoundRequestBuilder builder = getBuilderWithHeaderAndQuery("GET", url, queryParams);
         return executeAndWait(builder, timeoutSec, false);
     }
 
     private Response executeAndWait(final BoundRequestBuilder builder, final int timeoutSec, final boolean addContextHeader) {
-        
+
         if (addContextHeader) {
             builder.addHeader(JaxrsResource.HDR_CREATED_BY, createdBy);
             builder.addHeader(JaxrsResource.HDR_REASON, reason);
             builder.addHeader(JaxrsResource.HDR_COMMENT, comment);
         }
-        
+
         Response response = null;
         try {
-            ListenableFuture<Response> futureStatus = 
-                builder.execute(new AsyncCompletionHandler<Response>() {
-                    @Override
-                    public Response onCompleted(Response response) throws Exception {
-                        return response;
-                    }
-                });
+            final ListenableFuture<Response> futureStatus =
+                    builder.execute(new AsyncCompletionHandler<Response>() {
+                        @Override
+                        public Response onCompleted(final Response response) throws Exception {
+                            return response;
+                        }
+                    });
             response = futureStatus.get(timeoutSec, TimeUnit.SECONDS);
         } catch (Exception e) {
-            Assert.fail(e.getMessage());			
+            Assert.fail(e.getMessage());
         }
         Assert.assertNotNull(response);
         return response;
@@ -552,44 +542,43 @@ public class TestJaxrsBase {
         } else if (verb.equals("POST")) {
             builder = httpClient.preparePost(url);
         } else if (verb.equals("PUT")) {
-            builder = httpClient.preparePut(url);			
+            builder = httpClient.preparePut(url);
         } else if (verb.equals("DELETE")) {
-            builder = httpClient.prepareDelete(url);			
+            builder = httpClient.prepareDelete(url);
+        } else {
+            Assert.fail("Unknown verb " + verb);
         }
+
         builder.addHeader(HEADER_CONTENT_TYPE, CONTENT_TYPE);
-        for (Entry<String, String> q : queryParams.entrySet()) {
+        for (final Entry<String, String> q : queryParams.entrySet()) {
             builder.addQueryParameter(q.getKey(), q.getValue());
         }
-        
 
         return builder;
     }
 
     public AccountJson getAccountJson(final String name, final String externalKey, final String email) {
-        String accountId = UUID.randomUUID().toString();
-        int length = 4;
-        int billCycleDay = 12;
-        String currency = "USD";
-        String timeZone = "UTC";
-        String address1 = "12 rue des ecoles";
-        String address2 = "Poitier";
-        String company = "Renault";
-        String state = "Poitou";
-        String country = "France";
-        String phone = "81 53 26 56";
+        final String accountId = UUID.randomUUID().toString();
+        final int length = 4;
+        final int billCycleDay = 12;
+        final String currency = "USD";
+        final String timeZone = "UTC";
+        final String address1 = "12 rue des ecoles";
+        final String address2 = "Poitier";
+        final String company = "Renault";
+        final String state = "Poitou";
+        final String country = "France";
+        final String phone = "81 53 26 56";
 
         // Note: the accountId payload is ignored on account creation
-        AccountJson accountJson = new AccountJson(accountId, name, length, externalKey, email, billCycleDay, currency, null, timeZone, address1, address2, company, state, country, phone);
-        return accountJson;
+        return new AccountJson(accountId, name, length, externalKey, email, billCycleDay, currency, null, timeZone, address1, address2, company, state, country, phone);
     }
-    
+
     /**
-     * 
      * We could implement a ClockResource in jaxrs with the ability to sync on user token
      * but until we have a strong need for it, this is in the TODO list...
      */
     protected void crappyWaitForLackOfProperSynchonization() throws Exception {
         Thread.sleep(5000);
     }
-
 }