use of org.haiku.haikudepotserver.api1.model.repository.GetRepositoriesRequest in project haikudepotserver by haiku.
the class RepositoryApiImpl method getRepositories.
@Override
public GetRepositoriesResult getRepositories(final GetRepositoriesRequest getRepositoriesRequest) {
Preconditions.checkArgument(null != getRepositoriesRequest);
GetRepositoriesResult result = new GetRepositoriesResult();
boolean includeInactive = null != getRepositoriesRequest.includeInactive && getRepositoriesRequest.includeInactive;
result.repositories = Repository.getAll(serverRuntime.newContext()).stream().filter(r -> includeInactive || r.getActive()).map(r -> {
GetRepositoriesResult.Repository resultRepository = new GetRepositoriesResult.Repository();
resultRepository.code = r.getCode();
resultRepository.name = r.getName();
return resultRepository;
}).collect(Collectors.toList());
return result;
}
use of org.haiku.haikudepotserver.api1.model.repository.GetRepositoriesRequest in project haikudepotserver by haiku.
the class RepositoryApiIT method testGetRepositories.
@Test
public void testGetRepositories() {
integrationTestSupportService.createStandardTestData();
// ------------------------------------
GetRepositoriesResult result = repositoryApi.getRepositories(new GetRepositoriesRequest());
// ------------------------------------
Assertions.assertThat(result.repositories.size()).isEqualTo(1);
Assertions.assertThat(result.repositories.get(0).code).isEqualTo("testrepo");
}
Aggregations