use of org.candlepin.resource.ConsumerResource in project candlepin by candlepin.
the class HypervisorUpdateJobTest method init.
@Before
public void init() {
super.init();
i18n = I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.READ_PROPERTIES | I18nFactory.FALLBACK);
owner = mock(Owner.class);
principal = mock(Principal.class);
ownerCurator = mock(OwnerCurator.class);
consumerCurator = mock(ConsumerCurator.class);
consumerResource = mock(ConsumerResource.class);
consumerTypeCurator = mock(ConsumerTypeCurator.class);
subAdapter = mock(SubscriptionServiceAdapter.class);
complianceRules = mock(ComplianceRules.class);
when(owner.getId()).thenReturn("joe");
ConsumerType ctype = new ConsumerType(ConsumerTypeEnum.HYPERVISOR);
ctype.setId("test-ctype");
when(consumerTypeCurator.lookupByLabel(eq(ConsumerTypeEnum.HYPERVISOR.getLabel()))).thenReturn(ctype);
when(consumerTypeCurator.lookupByLabel(eq(ConsumerTypeEnum.HYPERVISOR.getLabel()), anyBoolean())).thenReturn(ctype);
when(owner.getKey()).thenReturn("joe");
when(principal.getUsername()).thenReturn("joe user");
testMigration = new GuestMigration(consumerCurator);
migrationProvider = Providers.of(testMigration);
hypervisorJson = "{\"hypervisors\":" + "[{" + "\"name\" : \"hypervisor_999\"," + "\"hypervisorId\" : {\"hypervisorId\":\"uuid_999\"}," + "\"guestIds\" : [{\"guestId\" : \"guestId_1_999\"}]" + "}]}";
}
Aggregations