Pull request #29: RED-2320: Fixed return dictionary entries

Merge in RED/persistence-service from RED-2320 to master

* commit '7f923978fff110616cb01f0e2e5cfd3a8638a82d':
  RED-2320: Fixed return dictionary entries
This commit is contained in:
Dominique Eiflaender 2021-09-30 13:59:04 +02:00
commit 8a63172b5c
2 changed files with 6 additions and 1 deletions

View File

@ -207,7 +207,10 @@ public class DictionaryController implements DictionaryResource {
@Override
public Type getDictionaryForType(@PathVariable(TYPE_PARAMETER_NAME) String typeId) {
return convert(dictionaryPersistenceService.getType(typeId), Type.class);
var entity = dictionaryPersistenceService.getType(typeId);
var target = convert(entity, Type.class);
target.setEntries(convert(entity.getEntries(), DictionaryEntry.class));
return target;
}
@Override

View File

@ -42,6 +42,8 @@ public class TypeTest extends AbstractPersistenceServerServiceTest {
var loadedType = dictionaryClient.getDictionaryForType(type.getId());
assertThat(loadedType.getEntries().size()).isEqualTo(3);
assertThat(loadedType.getVersion()).isGreaterThan(type.getVersion());
List<DictionaryEntry> dict = dictionaryClient.getEntriesForType(type.getId());