@Test public void getCertificatesTest() { CustomCertificateRepository customCertificateRepository = new MockCustomCertificateRepository(alias, content, testDate); DefaultCustomCertificateAccessor customCertificateAccessor = new DefaultCustomCertificateAccessor(customCertificateRepository); List<CustomCertificateModel> customCertificateModelList = customCertificateAccessor.getCertificates(); assertEquals(1, customCertificateModelList.size()); CustomCertificateModel customCertificateModel = customCertificateModelList.get(0); testCustomCertificateModel(expectedCustomCertificateModel, customCertificateModel); }
@Override public List<CustomCertificateModel> getCertificates() { return customCertificateRepository.findAll() .stream() .map(this::createModel) .collect(Collectors.toList()); }
DefaultCustomCertificateAccessor implements CustomCertificateAccessor { @Override public List<CustomCertificateModel> getCertificates() { return customCertificateRepository.findAll() .stream() .map(this::createModel) .collect(Collectors.toList()); } }
DefaultCustomCertificateAccessor implements CustomCertificateAccessor { @Override public List<CustomCertificateModel> getCertificates() { return customCertificateRepository.findAll() .stream() .map(this::createModel) .collect(Collectors.toList()); } @Autowired  DefaultCustomCertificateAccessor(CustomCertificateRepository customCertificateRepository); }
DefaultCustomCertificateAccessor implements CustomCertificateAccessor { @Override public List<CustomCertificateModel> getCertificates() { return customCertificateRepository.findAll() .stream() .map(this::createModel) .collect(Collectors.toList()); } @Autowired  DefaultCustomCertificateAccessor(CustomCertificateRepository customCertificateRepository); @Override List<CustomCertificateModel> getCertificates(); @Override Optional<CustomCertificateModel> getCertificate(Long id); @Override CustomCertificateModel storeCertificate(CustomCertificateModel certificateModel); @Override void deleteCertificate(String certificateAlias); @Override void deleteCertificate(Long certificateId); }
DefaultCustomCertificateAccessor implements CustomCertificateAccessor { @Override public List<CustomCertificateModel> getCertificates() { return customCertificateRepository.findAll() .stream() .map(this::createModel) .collect(Collectors.toList()); } @Autowired  DefaultCustomCertificateAccessor(CustomCertificateRepository customCertificateRepository); @Override List<CustomCertificateModel> getCertificates(); @Override Optional<CustomCertificateModel> getCertificate(Long id); @Override CustomCertificateModel storeCertificate(CustomCertificateModel certificateModel); @Override void deleteCertificate(String certificateAlias); @Override void deleteCertificate(Long certificateId);  }