Search in sources :

Example 11 with I18n

use of org.xnap.commons.i18n.I18n in project candlepin by candlepin.

the class StatusReasonMessageGeneratorTest method setUp.

@Before
public void setUp() {
    Locale locale = new Locale("en_US");
    I18n i18n = I18nFactory.getI18n(getClass(), "org.candlepin.i18n.Messages", locale, I18nFactory.FALLBACK);
    generator = new StatusReasonMessageGenerator(i18n);
    owner = new Owner("test");
    ConsumerType ctype = new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM);
    ctype.setId("test-ctype");
    consumer = new Consumer();
    consumer.setType(ctype);
    ent1 = mockEntitlement(consumer, TestUtil.createProduct("id1", "Nonstacked Product"));
    ent1.setId("ent1");
    entStacked1 = mockBaseStackedEntitlement(consumer, "stack", TestUtil.createProduct("Stacked Product", "Stack Subscription One"));
    entStacked2 = mockBaseStackedEntitlement(consumer, "stack", TestUtil.createProduct("Stacked Product", "Stack Subscription Two"));
    consumer.addEntitlement(ent1);
    consumer.addEntitlement(entStacked1);
    consumer.addEntitlement(entStacked2);
}
Also used : Locale(java.util.Locale) Owner(org.candlepin.model.Owner) Consumer(org.candlepin.model.Consumer) ConsumerType(org.candlepin.model.ConsumerType) I18n(org.xnap.commons.i18n.I18n) Before(org.junit.Before)

Aggregations

I18n (org.xnap.commons.i18n.I18n)11 Before (org.junit.Before)6 Owner (org.candlepin.model.Owner)3 HashSet (java.util.HashSet)2 List (java.util.List)2 Locale (java.util.Locale)2 BadRequestException (org.candlepin.common.exceptions.BadRequestException)2 Product (org.candlepin.model.Product)2 ProductCurator (org.candlepin.model.ProductCurator)2 Subscription (org.candlepin.model.dto.Subscription)2 Test (org.junit.Test)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 OAuthAccessor (net.oauth.OAuthAccessor)1 OAuthException (net.oauth.OAuthException)1 OAuthMessage (net.oauth.OAuthMessage)1 OAuthProblemException (net.oauth.OAuthProblemException)1 EventAdapterImpl (org.candlepin.audit.EventAdapterImpl)1