@Test void testTypedMultiReferenceNotFileMeta() { Entity entity = mock(Entity.class); PretendingEntity pretendingEntity = new PretendingEntity(entity, new HashMap<>()); Exception exception = assertThrows( UnsupportedOperationException.class, () -> pretendingEntity.getEntities("ref", Plugin.class)); assertThat(exception.getMessage()).containsPattern("Can't return typed pretending entities"); }
@Override public Iterable<Entity> getEntities(String attributeName) { return stream(delegate().getEntities(attributeName)) .map(this::newPretendingEntity) .collect(toList()); }
PretendingEntity extends AbstractEntityDecorator { @Override public Iterable<Entity> getEntities(String attributeName) { return stream(delegate().getEntities(attributeName)) .map(this::newPretendingEntity) .collect(toList()); } }
PretendingEntity extends AbstractEntityDecorator { @Override public Iterable<Entity> getEntities(String attributeName) { return stream(delegate().getEntities(attributeName)) .map(this::newPretendingEntity) .collect(toList()); } PretendingEntity(Entity entity, Map<String, EntityType> copiedEntityTypes); }
PretendingEntity extends AbstractEntityDecorator { @Override public Iterable<Entity> getEntities(String attributeName) { return stream(delegate().getEntities(attributeName)) .map(this::newPretendingEntity) .collect(toList()); } PretendingEntity(Entity entity, Map<String, EntityType> copiedEntityTypes); @Override EntityType getEntityType(); @Override Entity getEntity(String attributeName); @Override @SuppressWarnings("unchecked") E getEntity(String attributeName, Class<E> clazz); @Override Iterable<Entity> getEntities(String attributeName); @Override @SuppressWarnings("unchecked") Iterable<E> getEntities(String attributeName, Class<E> clazz); }
PretendingEntity extends AbstractEntityDecorator { @Override public Iterable<Entity> getEntities(String attributeName) { return stream(delegate().getEntities(attributeName)) .map(this::newPretendingEntity) .collect(toList()); } PretendingEntity(Entity entity, Map<String, EntityType> copiedEntityTypes); @Override EntityType getEntityType(); @Override Entity getEntity(String attributeName); @Override @SuppressWarnings("unchecked") E getEntity(String attributeName, Class<E> clazz); @Override Iterable<Entity> getEntities(String attributeName); @Override @SuppressWarnings("unchecked") Iterable<E> getEntities(String attributeName, Class<E> clazz);  }