final CapabilityContext capabilityContext = mock(CapabilityContext.class);
when(reference.context()).thenReturn(capabilityContext);
when(capabilityContext.id()).thenReturn(CapabilityIdentity.capabilityIdentity("ID"));
when(capabilityContext.isEnabled()).thenReturn(true);
when(capabilityContext.notes()).thenReturn("Notes");
when(reference.capabilityAs(GenerateMetadataCapability.class)).thenReturn(yumRepositoryCapability);
Map<String, String> aliases = Maps.newHashMap();
aliases.put("foo", "bar");
when(yumRepositoryCapability.getConfig()).thenReturn(
new GenerateMetadataCapabilityConfiguration(RELEASES, aliases, true, 1, "/comps.xml")
);