added stats mock to unit tests

pull/588/head
Justin Richer 11 years ago
parent 521017c5c2
commit 318a28ddf8

@ -33,6 +33,7 @@ import org.mitre.oauth2.service.SystemScopeService;
import org.mitre.openid.connect.model.WhitelistedSite;
import org.mitre.openid.connect.service.ApprovedSiteService;
import org.mitre.openid.connect.service.BlacklistedSiteService;
import org.mitre.openid.connect.service.StatsService;
import org.mitre.openid.connect.service.WhitelistedSiteService;
import org.mockito.InjectMocks;
import org.mockito.Matchers;
@ -68,12 +69,15 @@ public class TestDefaultOAuth2ClientDetailsEntityService {
@Mock
private SystemScopeService scopeService;
@Mock
private StatsService statsService;
@InjectMocks
private DefaultOAuth2ClientDetailsEntityService service;
@Before
public void prepare() {
Mockito.reset(clientRepository, tokenRepository, approvedSiteService, whitelistedSiteService, blacklistedSiteService, scopeService);
Mockito.reset(clientRepository, tokenRepository, approvedSiteService, whitelistedSiteService, blacklistedSiteService, scopeService, statsService);
}
/**

@ -30,6 +30,7 @@ import org.mitre.oauth2.model.ClientDetailsEntity;
import org.mitre.openid.connect.model.ApprovedSite;
import org.mitre.openid.connect.repository.ApprovedSiteRepository;
import org.mitre.openid.connect.service.ApprovedSiteService;
import org.mitre.openid.connect.service.StatsService;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
@ -51,6 +52,9 @@ public class TestDefaultApprovedSiteService {
@Mock
private ApprovedSiteRepository repository;
@Mock
private StatsService statsService;
@InjectMocks
private ApprovedSiteService service = new DefaultApprovedSiteService();
@ -80,7 +84,7 @@ public class TestDefaultApprovedSiteService {
site3.setUserId("user2");
site3.setClientId(clientId);
Mockito.reset(repository);
Mockito.reset(repository, statsService);
}

Loading…
Cancel
Save