diff --git a/util/src/test/java/com/ning/billing/mock/MockInvoiceFormatterFactory.java b/util/src/test/java/com/ning/billing/mock/MockInvoiceFormatterFactory.java
new file mode 100644
index 0000000..30282b7
--- /dev/null
+++ b/util/src/test/java/com/ning/billing/mock/MockInvoiceFormatterFactory.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2010-2012 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.mock;
+
+import java.util.Locale;
+
+import com.ning.billing.invoice.api.Invoice;
+import com.ning.billing.invoice.api.formatters.InvoiceFormatter;
+import com.ning.billing.invoice.api.formatters.InvoiceFormatterFactory;
+import com.ning.billing.util.template.translation.TranslatorConfig;
+
+public class MockInvoiceFormatterFactory implements InvoiceFormatterFactory {
+ @Override
+ public InvoiceFormatter createInvoiceFormatter(final TranslatorConfig config, final Invoice invoice, final Locale locale) {
+ return null;
+ }
+}
diff --git a/util/src/test/java/com/ning/billing/util/email/DefaultCatalogTranslationTest.java b/util/src/test/java/com/ning/billing/util/email/DefaultCatalogTranslationTest.java
index 99c53f3..d092a5a 100644
--- a/util/src/test/java/com/ning/billing/util/email/DefaultCatalogTranslationTest.java
+++ b/util/src/test/java/com/ning/billing/util/email/DefaultCatalogTranslationTest.java
@@ -15,11 +15,14 @@ package com.ning.billing.util.email;/*
*/
import java.util.Locale;
+import java.util.Map;
+import org.skife.config.ConfigSource;
import org.skife.config.ConfigurationObjectFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
+import com.google.common.collect.ImmutableMap;
import com.ning.billing.util.template.translation.DefaultCatalogTranslator;
import com.ning.billing.util.template.translation.Translator;
import com.ning.billing.util.template.translation.TranslatorConfig;
@@ -32,7 +35,17 @@ public class DefaultCatalogTranslationTest {
@BeforeClass(groups = {"fast", "email"})
public void setup() {
- final TranslatorConfig config = new ConfigurationObjectFactory(System.getProperties()).build(TranslatorConfig.class);
+ final ConfigSource configSource = new ConfigSource() {
+ private final Map<String, String> properties = ImmutableMap.<String, String>of("killbill.template.invoiceFormatterFactoryClass",
+ "com.ning.billing.mock.MockInvoiceFormatterFactory");
+
+ @Override
+ public String getString(final String propertyName) {
+ return properties.get(propertyName);
+ }
+ };
+
+ final TranslatorConfig config = new ConfigurationObjectFactory(configSource).build(TranslatorConfig.class);
translation = new DefaultCatalogTranslator(config);
}