@Test public void testListEnvironmentsWithoutEnvironmentNamePrefix() throws Exception { when(environmentDDBRecords.stream()).thenReturn(Stream.of(environmentDDBRecord)); doReturn(environmentDDBRecords) .when(dynamoDBMapper) .query(eq(EnvironmentDDBRecord.class), any()); when(environmentMapper.toEnvironment(environmentDDBRecord)).thenReturn(environment); final List<Environment> result = environmentRepositoryDDB.listEnvironments(cluster, null); verify(dynamoDBMapper) .query(eq(EnvironmentDDBRecord.class), ddbQueryExpressionCaptor.capture()); verify(environmentMapper).toEnvironment(environmentDDBRecord); final EnvironmentDDBRecord queriedEnvironmentDDBRecord = ddbQueryExpressionCaptor.getValue().getHashKeyValues(); assertThat(ddbQueryExpressionCaptor.getValue().getRangeKeyConditions()).isNull(); assertThat(queriedEnvironmentDDBRecord.getAccountIdCluster()) .isEqualTo(cluster.generateAccountIdCluster()); assertThat(result.size()).isEqualTo(1); assertThat(result.get(0)).isEqualTo(environment); }
@Override public List<Environment> listEnvironments(@NonNull final Cluster cluster) throws InternalServiceException { return listEnvironments(cluster, null); }
EnvironmentRepositoryDDB implements EnvironmentRepository { @Override public List<Environment> listEnvironments(@NonNull final Cluster cluster) throws InternalServiceException { return listEnvironments(cluster, null); } }
EnvironmentRepositoryDDB implements EnvironmentRepository { @Override public List<Environment> listEnvironments(@NonNull final Cluster cluster) throws InternalServiceException { return listEnvironments(cluster, null); }  }
EnvironmentRepositoryDDB implements EnvironmentRepository { @Override public List<Environment> listEnvironments(@NonNull final Cluster cluster) throws InternalServiceException { return listEnvironments(cluster, null); }  @Override Environment createEnvironmentAndEnvironmentRevision(
      @NonNull final Environment environment,
      @NonNull final EnvironmentRevision environmentRevision); @Override Environment updateEnvironment(Environment environment); @Override EnvironmentRevision getEnvironmentRevision(
      @NonNull final EnvironmentId environmentId, @NonNull final String environmentRevisionId); EnvironmentRevision createEnvironmentRevision(
      @NonNull final EnvironmentRevision environmentRevision); @Override Environment getEnvironment(@NonNull final EnvironmentId environmentId); @Override List<Environment> listEnvironments(@NonNull final Cluster cluster); @Override List<Environment> listEnvironments(
      @NonNull final Cluster cluster, final String environmentNamePrefix); @Override List<EnvironmentRevision> listEnvironmentRevisions(
      @NonNull final EnvironmentId environmentId); @Override void deleteEnvironmentRevision(@NonNull final EnvironmentRevision environmentRevision); @Override List<Cluster> listClusters(String accountId, String clusterNamePrefix); @Override void deleteEnvironment(@NonNull final EnvironmentId environmentId); }
EnvironmentRepositoryDDB implements EnvironmentRepository { @Override public List<Environment> listEnvironments(@NonNull final Cluster cluster) throws InternalServiceException { return listEnvironments(cluster, null); }  @Override Environment createEnvironmentAndEnvironmentRevision(
      @NonNull final Environment environment,
      @NonNull final EnvironmentRevision environmentRevision); @Override Environment updateEnvironment(Environment environment); @Override EnvironmentRevision getEnvironmentRevision(
      @NonNull final EnvironmentId environmentId, @NonNull final String environmentRevisionId); EnvironmentRevision createEnvironmentRevision(
      @NonNull final EnvironmentRevision environmentRevision); @Override Environment getEnvironment(@NonNull final EnvironmentId environmentId); @Override List<Environment> listEnvironments(@NonNull final Cluster cluster); @Override List<Environment> listEnvironments(
      @NonNull final Cluster cluster, final String environmentNamePrefix); @Override List<EnvironmentRevision> listEnvironmentRevisions(
      @NonNull final EnvironmentId environmentId); @Override void deleteEnvironmentRevision(@NonNull final EnvironmentRevision environmentRevision); @Override List<Cluster> listClusters(String accountId, String clusterNamePrefix); @Override void deleteEnvironment(@NonNull final EnvironmentId environmentId);  }