RED-2320: Fixed return dictionary entries

This commit is contained in:
Dominique Eifländer 2021-09-30 13:50:29 +02:00
parent cabe693cc3
commit 7f923978ff
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());