use of dk.dbc.search.solrdocstore.jpa.QueueRuleKey in project solr-document-store by DBCDK.
the class QueueRuleEntityIT method storeAndLoadEntity.
@Test
public void storeAndLoadEntity() {
System.out.println("storeAndLoadEntity");
EntityManager em = env().getEntityManager();
EnumSet.allOf(QueueType.class).forEach(type -> {
System.out.println(" - testing: " + type);
env().getPersistenceContext().run(() -> {
em.persist(new QueueRuleEntity("foo", type, -456));
});
env().clearEntityManagerCache();
QueueRuleEntity qr = env().getPersistenceContext().run(() -> em.find(QueueRuleEntity.class, new QueueRuleKey("foo", type)));
assertThat(qr.getQueue(), is("foo"));
assertThat(qr.getSupplier(), is(type));
assertThat(qr.getPostpone(), is(-456));
env().getPersistenceContext().run(() -> em.remove(em.find(QueueRuleEntity.class, new QueueRuleKey("foo", type))));
});
}
Aggregations