added stats mock to unit tests
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;
|
||||
|
@ -67,13 +68,16 @@ 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;
|
||||
|
@ -50,6 +51,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…
Reference in New Issue