@Test public void caching() throws Exception { cacheEvictor.setEvict(false); certificateAuthorityService.getCertificateAuthorities(null); int expectedExecutions = 1; verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); certificateAuthorityService.getCertificateAuthorities(null); verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); certificateAuthorityService.getCertificateAuthorities(null, true); expectedExecutions++; verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.AUTHENTICATION); certificateAuthorityService.getCertificateAuthorities(null, false); certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.SIGNING, true); certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.SIGNING, false); expectedExecutions += 4; verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.AUTHENTICATION); certificateAuthorityService.getCertificateAuthorities(null, false); certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.SIGNING, false); certificateAuthorityService.getCertificateAuthorities(KeyUsageInfo.SIGNING, false); verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); evictCache(); certificateAuthorityService.getCertificateAuthorities(null); expectedExecutions++; verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); certificateAuthorityService.getCertificateAuthorities(null); verify(globalConfFacade, times(expectedExecutions)).getAllCaCerts(any()); }
@Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } @Autowired  CertificateAuthorityService(GlobalConfService globalConfService,
            GlobalConfFacade globalConfFacade,
            ClientService clientService,
            SignerProxyFacade signerProxyFacade,
            CurrentSecurityServerId currentSecurityServerId); }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } @Autowired  CertificateAuthorityService(GlobalConfService globalConfService,
            GlobalConfFacade globalConfFacade,
            ClientService clientService,
            SignerProxyFacade signerProxyFacade,
            CurrentSecurityServerId currentSecurityServerId); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo,
            boolean includeIntermediateCas); CertificateProfileInfo getCertificateProfile(String caName, KeyUsageInfo keyUsageInfo, ClientId memberId,
            boolean isNewMember); ApprovedCAInfo getCertificateAuthorityInfo(String caName); }
CertificateAuthorityService { @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) public List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo) throws InconsistentCaDataException { return getCertificateAuthorities(keyUsageInfo, false); } @Autowired  CertificateAuthorityService(GlobalConfService globalConfService,
            GlobalConfFacade globalConfFacade,
            ClientService clientService,
            SignerProxyFacade signerProxyFacade,
            CurrentSecurityServerId currentSecurityServerId); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo); @Cacheable(GET_CERTIFICATE_AUTHORITIES_CACHE) List<ApprovedCaDto> getCertificateAuthorities(KeyUsageInfo keyUsageInfo,
            boolean includeIntermediateCas); CertificateProfileInfo getCertificateProfile(String caName, KeyUsageInfo keyUsageInfo, ClientId memberId,
            boolean isNewMember); ApprovedCAInfo getCertificateAuthorityInfo(String caName); static final String OCSP_RESPONSE_NOT_AVAILABLE; }