@Test
public void should_instantiate_embeddedId_with_partition_components() throws Exception {
//Given
CompleteBean pk = new CompleteBean();
List<Field> fields = Arrays.asList(CompleteBean.class.getDeclaredField("id"), CompleteBean.class.getDeclaredField("name"));
List<Object> components = Arrays.<Object>asList(10L, "DuyHai");
when(meta.<CompleteBean>getValueClass()).thenReturn(CompleteBean.class);
when(meta.forValues().instantiate()).thenReturn(pk);
when(meta.getEmbeddedIdProperties().getPartitionComponents().getComponentFields()).thenReturn(fields);
PropertyMetaSliceQueryContext view = new PropertyMetaSliceQueryContext(meta);
//When
final Object actual = view.instantiateEmbeddedIdWithPartitionComponents(components);
//Then
assertThat(actual).isSameAs(pk);
assertThat(pk.getId()).isEqualTo(10L);
assertThat(pk.getName()).isEqualTo("DuyHai");
}