@Test void getAttributeNames() { Entity entity = new DynamicEntity(entityType); Attribute attr0 = when(mock(Attribute.class).getName()).thenReturn("attr0").getMock(); Attribute attr1 = when(mock(Attribute.class).getName()).thenReturn("attr1").getMock(); when(entityType.getAtomicAttributes()).thenReturn(Arrays.asList(attr0, attr1)); assertEquals(asList("attr0", "attr1"), newArrayList(entity.getAttributeNames())); }
@Override public Iterable<String> getAttributeNames() { return EntityTypeUtils.getAttributeNames(entityType.getAtomicAttributes()); }
LazyEntity implements Entity { @Override public Iterable<String> getAttributeNames() { return EntityTypeUtils.getAttributeNames(entityType.getAtomicAttributes()); } }
LazyEntity implements Entity { @Override public Iterable<String> getAttributeNames() { return EntityTypeUtils.getAttributeNames(entityType.getAtomicAttributes()); } LazyEntity(EntityType entityType, DataService dataService, Object id); }
LazyEntity implements Entity { @Override public Iterable<String> getAttributeNames() { return EntityTypeUtils.getAttributeNames(entityType.getAtomicAttributes()); } LazyEntity(EntityType entityType, DataService dataService, Object id); @Override Object getIdValue(); @Override void setIdValue(Object id); EntityType getEntityType(); @Override Iterable<String> getAttributeNames(); @Override Object getLabelValue(); @Override Object get(String attributeName); @Override String getString(String attributeName); @Override Integer getInt(String attributeName); @Override Long getLong(String attributeName); @Override Boolean getBoolean(String attributeName); @Override Double getDouble(String attributeName); @Override Instant getInstant(String attributeName); @Override LocalDate getLocalDate(String attributeName); @Override Entity getEntity(String attributeName); @Override E getEntity(String attributeName, Class<E> clazz); @Override Iterable<Entity> getEntities(String attributeName); @Override Iterable<E> getEntities(String attributeName, Class<E> clazz); @Override void set(String attributeName, Object value); @Override void set(Entity values); @Override String toString(); }
LazyEntity implements Entity { @Override public Iterable<String> getAttributeNames() { return EntityTypeUtils.getAttributeNames(entityType.getAtomicAttributes()); } LazyEntity(EntityType entityType, DataService dataService, Object id); @Override Object getIdValue(); @Override void setIdValue(Object id); EntityType getEntityType(); @Override Iterable<String> getAttributeNames(); @Override Object getLabelValue(); @Override Object get(String attributeName); @Override String getString(String attributeName); @Override Integer getInt(String attributeName); @Override Long getLong(String attributeName); @Override Boolean getBoolean(String attributeName); @Override Double getDouble(String attributeName); @Override Instant getInstant(String attributeName); @Override LocalDate getLocalDate(String attributeName); @Override Entity getEntity(String attributeName); @Override E getEntity(String attributeName, Class<E> clazz); @Override Iterable<Entity> getEntities(String attributeName); @Override Iterable<E> getEntities(String attributeName, Class<E> clazz); @Override void set(String attributeName, Object value); @Override void set(Entity values); @Override String toString();  }