@Test void listByAccountId() { environmentViewServiceUnderTest.listByAccountId(ACCOUNT_ID); verify(environmentViewRepository).findAllByAccountId(eq(ACCOUNT_ID)); }
public Set<SimpleEnvironmentResponse> listByAccountId(String accountId) { return findAllByAccountId(accountId).stream() .map(env -> conversionService.convert(env, SimpleEnvironmentResponse.class)) .collect(Collectors.toSet()); }
EnvironmentViewService { public Set<SimpleEnvironmentResponse> listByAccountId(String accountId) { return findAllByAccountId(accountId).stream() .map(env -> conversionService.convert(env, SimpleEnvironmentResponse.class)) .collect(Collectors.toSet()); } }
EnvironmentViewService { public Set<SimpleEnvironmentResponse> listByAccountId(String accountId) { return findAllByAccountId(accountId).stream() .map(env -> conversionService.convert(env, SimpleEnvironmentResponse.class)) .collect(Collectors.toSet()); } EnvironmentViewService(EnvironmentViewRepository environmentViewRepository, ConversionService conversionService); }
EnvironmentViewService { public Set<SimpleEnvironmentResponse> listByAccountId(String accountId) { return findAllByAccountId(accountId).stream() .map(env -> conversionService.convert(env, SimpleEnvironmentResponse.class)) .collect(Collectors.toSet()); } EnvironmentViewService(EnvironmentViewRepository environmentViewRepository, ConversionService conversionService); Set<EnvironmentView> findByNamesInAccount(Set<String> names, @NotNull String accountid); Set<EnvironmentView> findByResourceCrnsInAccount(Set<String> resourceCrns, @NotNull String accountid); Set<SimpleEnvironmentResponse> listByAccountId(String accountId); Set<EnvironmentView> findAllByAccountId(String accountId); Set<EnvironmentView> findAllByCredentialId(Long credentialId); Long getIdByName(String environmentName, String accountId); Long getIdByCrn(String crn, String accountId); }
EnvironmentViewService { public Set<SimpleEnvironmentResponse> listByAccountId(String accountId) { return findAllByAccountId(accountId).stream() .map(env -> conversionService.convert(env, SimpleEnvironmentResponse.class)) .collect(Collectors.toSet()); } EnvironmentViewService(EnvironmentViewRepository environmentViewRepository, ConversionService conversionService); Set<EnvironmentView> findByNamesInAccount(Set<String> names, @NotNull String accountid); Set<EnvironmentView> findByResourceCrnsInAccount(Set<String> resourceCrns, @NotNull String accountid); Set<SimpleEnvironmentResponse> listByAccountId(String accountId); Set<EnvironmentView> findAllByAccountId(String accountId); Set<EnvironmentView> findAllByCredentialId(Long credentialId); Long getIdByName(String environmentName, String accountId); Long getIdByCrn(String crn, String accountId);  }