}
@Test
public void upstreamConsumers() {
Principal p = mock(Principal.class);
OwnerCurator oc = mock(OwnerCurator.class);
UpstreamConsumer upstream = mock(UpstreamConsumer.class);
Owner owner = mock(Owner.class);
OwnerResource ownerres = new OwnerResource(oc, null,
null, null, null, i18n, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null,
contentOverrideValidator, serviceLevelValidator, null);
when(oc.lookupByKey(eq("admin"))).thenReturn(owner);
when(owner.getUpstreamConsumer()).thenReturn(upstream);
List<UpstreamConsumer> results = ownerres.getUpstreamConsumers(p, "admin");
assertNotNull(results);
assertEquals(1, results.size());