Search in sources :

Example 1 with SimpleIntIdEntityView

use of com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.SimpleIntIdEntityView in project blaze-persistence by Blazebit.

the class EntityViewUpdateMutableNestedEmbeddableMapsTest method assertSubviewEquals.

private void assertSubviewEquals(Map<String, IntIdEntity> entities, Map<String, SimpleIntIdEntityView> views) {
    assertEquals(entities.size(), views.size());
    Map<String, SimpleIntIdEntityView> unmatched = new HashMap<>(views);
    for (Map.Entry<String, IntIdEntity> entry : entities.entrySet()) {
        IntIdEntity value = entry.getValue();
        SimpleIntIdEntityView view = unmatched.remove(entry.getKey());
        if (view == null || !value.getId().equals(view.getId())) {
            Assert.fail("Unmatched name object: " + value);
        }
    }
    if (!unmatched.isEmpty()) {
        Assert.fail("Unmatched views: " + unmatched);
    }
}
Also used : IntIdEntity(com.blazebit.persistence.testsuite.entity.IntIdEntity) SimpleIntIdEntityView(com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.SimpleIntIdEntityView) HashMap(java.util.HashMap) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

IntIdEntity (com.blazebit.persistence.testsuite.entity.IntIdEntity)1 SimpleIntIdEntityView (com.blazebit.persistence.view.testsuite.update.embeddable.nested.model.SimpleIntIdEntityView)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1