@Test public void getAllowedIdsDefaultAggregatorAggregatorUser() throws Exception { this.mockUserRoles("aggregator"); Aggregator defaultAggregator = new Aggregator(); defaultAggregator.setAggregatorId(this.user.getEmail()); when(aggregatorManager.getDefaultAggregator()).thenReturn(defaultAggregator); this.testGetAllowedIdsCorrect(this.user.getEmail(), null, null, null); }
@Test public void getAllowedIdsSingleProviderAdminUser() throws RSSException { this.mockUserRoles("admin"); Aggregator defaultAggregator = new Aggregator(); defaultAggregator.setAggregatorId(this.user.getEmail()); when(aggregatorManager.getDefaultAggregator()).thenReturn(defaultAggregator); RSSProvider provider = new RSSProvider(); provider.setAggregatorId(this.user.getEmail()); provider.setProviderId(this.providerId); this.user.setId(this.providerId); when(providerManager.getProvider(this.user.getEmail(), this.providerId)).thenReturn(provider); this.testGetAllowedIdsSingleProvider(this.user.getEmail(), this.providerId, null, null); }