package com.ning.billing.entitlement.alignment;
import java.util.UUID;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.ning.billing.KillbillTestSuite;
import com.ning.billing.catalog.api.Plan;
import com.ning.billing.catalog.api.PlanPhase;
import com.ning.billing.entitlement.EntitlementTestSuiteNoDB;
import com.ning.billing.entitlement.events.EntitlementEvent;
import com.ning.billing.entitlement.events.user.ApiEventType;
public class TestTimedMigration extends EntitlementTestSuiteNoDB {
@Test(groups = "fast")
public void testConstructor() throws Exception {
final DateTime eventTime = new DateTime(DateTimeZone.UTC);
final EntitlementEvent.EventType eventType = EntitlementEvent.EventType.API_USER;
final ApiEventType apiEventType = ApiEventType.CREATE;
final Plan plan = Mockito.mock(Plan.class);
final PlanPhase phase = Mockito.mock(PlanPhase.class);
final String priceList = UUID.randomUUID().toString();
final TimedMigration timedMigration = new TimedMigration(eventTime, eventType, apiEventType, plan, phase, priceList);
final TimedMigration otherTimedMigration = new TimedMigration(eventTime, eventType, apiEventType, plan, phase, priceList);
Assert.assertEquals(otherTimedMigration, timedMigration);
Assert.assertEquals(timedMigration.getEventTime(), eventTime);
Assert.assertEquals(timedMigration.getEventType(), eventType);
Assert.assertEquals(timedMigration.getApiEventType(), apiEventType);
Assert.assertEquals(timedMigration.getPlan(), plan);
Assert.assertEquals(timedMigration.getPhase(), phase);
Assert.assertEquals(timedMigration.getPriceList(), priceList);
}
}