verify(valueMeta.forValues()).setValueToField(entity, "value");
}
@Test
public void should_map_row_to_entity_with_primary_key() throws Exception {
ClusteredEntity entity = new ClusteredEntity();
EmbeddedKey embeddedKey = new EmbeddedKey();
PropertyMeta idMeta = mock(PropertyMeta.class, RETURNS_DEEP_STUBS);
when(idMeta.structure().isEmbeddedId()).thenReturn(true);
Map<String, PropertyMeta> propertiesMap = new HashMap<>();
when(row.getColumnDefinitions()).thenReturn(columnDefs);
when(columnDefs.iterator()).thenReturn(Arrays.<Definition>asList().iterator());
when(entityMeta.forOperations().instanciate()).thenReturn(entity);
when(entityMeta.getIdMeta()).thenReturn(idMeta);
when(idMeta.forRowExtraction().extractCompoundPrimaryKeyFromRow(row, entityMeta, MANAGED)).thenReturn(embeddedKey);
ClusteredEntity actual = entityMapper.mapRowToEntityWithPrimaryKey(entityMeta, row, propertiesMap, MANAGED);
assertThat(actual).isSameAs(entity);
verify(idMeta.forValues()).setValueToField(entity, embeddedKey);
}