@Test public void testGet() { KerberosConfig expectedKerberosConfig = new KerberosConfig(); Mockito.when(crnService.getCurrentAccountId()).thenReturn(ACCOUNT_ID); Mockito.when(kerberosConfigRepository.findByAccountIdAndEnvironmentCrnAndClusterNameIsNullAndArchivedIsFalse(ACCOUNT_ID, ENVIRONMENT_ID)) .thenReturn(Optional.of(expectedKerberosConfig)); KerberosConfig actualResult = underTest.get(ENVIRONMENT_ID); assertEquals(expectedKerberosConfig, actualResult); }
public KerberosConfig get(String environmentCrn) { String accountId = crnService.getCurrentAccountId(); return kerberosConfigRepository.findByAccountIdAndEnvironmentCrnAndClusterNameIsNullAndArchivedIsFalse(accountId, environmentCrn) .orElseThrow(notFound("KerberosConfig for environment", environmentCrn)); }
KerberosConfigService extends AbstractArchivistService<KerberosConfig> { public KerberosConfig get(String environmentCrn) { String accountId = crnService.getCurrentAccountId(); return kerberosConfigRepository.findByAccountIdAndEnvironmentCrnAndClusterNameIsNullAndArchivedIsFalse(accountId, environmentCrn) .orElseThrow(notFound("KerberosConfig for environment", environmentCrn)); } }
KerberosConfigService extends AbstractArchivistService<KerberosConfig> { public KerberosConfig get(String environmentCrn) { String accountId = crnService.getCurrentAccountId(); return kerberosConfigRepository.findByAccountIdAndEnvironmentCrnAndClusterNameIsNullAndArchivedIsFalse(accountId, environmentCrn) .orElseThrow(notFound("KerberosConfig for environment", environmentCrn)); }  }
KerberosConfigService extends AbstractArchivistService<KerberosConfig> { public KerberosConfig get(String environmentCrn) { String accountId = crnService.getCurrentAccountId(); return kerberosConfigRepository.findByAccountIdAndEnvironmentCrnAndClusterNameIsNullAndArchivedIsFalse(accountId, environmentCrn) .orElseThrow(notFound("KerberosConfig for environment", environmentCrn)); }  KerberosConfig createKerberosConfig(KerberosConfig kerberosConfig); KerberosConfig createKerberosConfig(KerberosConfig kerberosConfig, String accountId); KerberosConfig get(String environmentCrn); Optional<KerberosConfig> find(String environmentCrn, String accountId, String clusterName); List<KerberosConfig> findAllInEnvironmentEvenIfArchived(String environmentCrn, String accountId); void delete(String environmentCrn); void delete(String environmentCrn, String accountId); void delete(String environmentCrn, String accountId, String clusterName); void deleteAllInEnvironment(String environmentCrn, String accountId); @Override JpaRepository repository(); }
KerberosConfigService extends AbstractArchivistService<KerberosConfig> { public KerberosConfig get(String environmentCrn) { String accountId = crnService.getCurrentAccountId(); return kerberosConfigRepository.findByAccountIdAndEnvironmentCrnAndClusterNameIsNullAndArchivedIsFalse(accountId, environmentCrn) .orElseThrow(notFound("KerberosConfig for environment", environmentCrn)); }  KerberosConfig createKerberosConfig(KerberosConfig kerberosConfig); KerberosConfig createKerberosConfig(KerberosConfig kerberosConfig, String accountId); KerberosConfig get(String environmentCrn); Optional<KerberosConfig> find(String environmentCrn, String accountId, String clusterName); List<KerberosConfig> findAllInEnvironmentEvenIfArchived(String environmentCrn, String accountId); void delete(String environmentCrn); void delete(String environmentCrn, String accountId); void delete(String environmentCrn, String accountId, String clusterName); void deleteAllInEnvironment(String environmentCrn, String accountId); @Override JpaRepository repository();  }