Fixed test

This commit is contained in:
Luca Frosini 2021-09-14 16:34:40 +02:00
parent 85c773fb1b
commit a1fbd07378
1 changed files with 9 additions and 6 deletions

View File

@ -120,12 +120,13 @@ public class QueryTest extends ERManagementTest {
json = isRelatedToManagement.all(true);
List<Resource> resourcesList = ElementMapper.unmarshalList(Resource.class, json);
@SuppressWarnings("rawtypes")
List<IsRelatedTo> resourcesList = ElementMapper.unmarshalList(IsRelatedTo.class, json);
logger.debug("{} are {} : {} ", IsRelatedTo.NAME, resourcesList.size(), resourcesList);
Assert.assertTrue(resourcesList.size() == MAX);
json = isRelatedToManagement.all(false);
resourcesList = ElementMapper.unmarshalList(Resource.class, json);
resourcesList = ElementMapper.unmarshalList(IsRelatedTo.class, json);
Assert.assertTrue(resourcesList.size() == 0);
/* Getting all ConsistsOf polymorphic and non polymorphic */
@ -134,12 +135,14 @@ public class QueryTest extends ERManagementTest {
.getERManagement(ConsistsOf.NAME);
json = consistsOfManagement.all(true);
List<Resource> consistsOfPolimorphicList = ElementMapper.unmarshalList(Resource.class, json);
logger.debug("{} are {} : {} ", IsRelatedTo.NAME, consistsOfPolimorphicList.size(), consistsOfPolimorphicList);
@SuppressWarnings("rawtypes")
List<ConsistsOf> consistsOfPolimorphicList = ElementMapper.unmarshalList(ConsistsOf.class, json);
logger.debug("{} are {} : {} ", ConsistsOf.NAME, consistsOfPolimorphicList.size(), consistsOfPolimorphicList);
json = consistsOfManagement.all(false);
List<Resource> consistsOfNonPolimorphicList = ElementMapper.unmarshalList(Resource.class, json);
logger.debug("{} are {} : {} ", IsRelatedTo.NAME, consistsOfNonPolimorphicList.size(),
@SuppressWarnings("rawtypes")
List<ConsistsOf> consistsOfNonPolimorphicList = ElementMapper.unmarshalList(ConsistsOf.class, json);
logger.debug("{} are {} : {} ", ConsistsOf.NAME, consistsOfNonPolimorphicList.size(),
consistsOfNonPolimorphicList);
Assert.assertTrue(consistsOfPolimorphicList.size() >= consistsOfNonPolimorphicList.size());