@Test void getTypedValueStringAttributeEntityManagerOneToMany() { String valueStr = "0,1,2"; Attribute attr = mock(Attribute.class); EntityType refEntityType = mock(EntityType.class); Attribute refIdAttr = mock(Attribute.class); when(refIdAttr.getDataType()).thenReturn(INT); when(refEntityType.getIdAttribute()).thenReturn(refIdAttr); when(attr.hasRefEntity()).thenReturn(true); when(attr.getRefEntity()).thenReturn(refEntityType); when(attr.getDataType()).thenReturn(ONE_TO_MANY); EntityManager entityManager = mock(EntityManager.class); Entity entity0 = mock(Entity.class); Entity entity1 = mock(Entity.class); Entity entity2 = mock(Entity.class); when(entityManager.getReference(refEntityType, 0)).thenReturn(entity0); when(entityManager.getReference(refEntityType, 1)).thenReturn(entity1); when(entityManager.getReference(refEntityType, 2)).thenReturn(entity2); assertEquals( newArrayList(entity0, entity1, entity2), getTypedValue(valueStr, attr, entityManager)); }
public static Object getTypedValue(String valueStr, Attribute attr) { if (EntityTypeUtils.isReferenceType(attr)) { throw new MolgenisDataException( "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities"); } return getTypedValue(valueStr, attr, null); }
EntityUtils { public static Object getTypedValue(String valueStr, Attribute attr) { if (EntityTypeUtils.isReferenceType(attr)) { throw new MolgenisDataException( "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities"); } return getTypedValue(valueStr, attr, null); } }
EntityUtils { public static Object getTypedValue(String valueStr, Attribute attr) { if (EntityTypeUtils.isReferenceType(attr)) { throw new MolgenisDataException( "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities"); } return getTypedValue(valueStr, attr, null); } private  EntityUtils(); }
EntityUtils { public static Object getTypedValue(String valueStr, Attribute attr) { if (EntityTypeUtils.isReferenceType(attr)) { throw new MolgenisDataException( "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities"); } return getTypedValue(valueStr, attr, null); } private  EntityUtils(); static Object getTypedValue(String valueStr, Attribute attr); static Object getTypedValue(String valueStr, Attribute attr, EntityManager entityManager); static boolean equals(EntityType entityType, EntityType otherEntityType); static boolean equals(Iterable<Attribute> attrsIt, Iterable<Attribute> otherAttrsIt); static boolean equalsEntities(
      Iterable<Entity> entityIterable, Iterable<Entity> otherEntityIterable); static boolean equals(Tag tag, Tag otherTag); static boolean equals(Attribute attr, Attribute otherAttr); static boolean equals(Attribute attr, Attribute otherAttr, boolean checkIdentifier); static boolean equals(Entity entity, Entity otherEntity); static int hashCode(Entity entity); static boolean isNullValue(Entity entity, Attribute attribute); static boolean isSame(Entity thisEntity, Entity thatEntity); }
EntityUtils { public static Object getTypedValue(String valueStr, Attribute attr) { if (EntityTypeUtils.isReferenceType(attr)) { throw new MolgenisDataException( "getTypedValue(String, AttributeMetadata) can't be used for attributes referencing entities"); } return getTypedValue(valueStr, attr, null); } private  EntityUtils(); static Object getTypedValue(String valueStr, Attribute attr); static Object getTypedValue(String valueStr, Attribute attr, EntityManager entityManager); static boolean equals(EntityType entityType, EntityType otherEntityType); static boolean equals(Iterable<Attribute> attrsIt, Iterable<Attribute> otherAttrsIt); static boolean equalsEntities(
      Iterable<Entity> entityIterable, Iterable<Entity> otherEntityIterable); static boolean equals(Tag tag, Tag otherTag); static boolean equals(Attribute attr, Attribute otherAttr); static boolean equals(Attribute attr, Attribute otherAttr, boolean checkIdentifier); static boolean equals(Entity entity, Entity otherEntity); static int hashCode(Entity entity); static boolean isNullValue(Entity entity, Attribute attribute); static boolean isSame(Entity thisEntity, Entity thatEntity);  }