use of io.joynr.capabilities.GlobalDiscoveryEntryPersisted in project joynr by bmwcarit.
the class GlobalCapabilitiesDirectoryEjbTest method testTouch.
@Test
public void testTouch() throws InterruptedException {
long initialLastSeen = testGlobalDiscoveryEntry.getLastSeenDateMs();
subject.add(testGlobalDiscoveryEntry);
entityManager.flush();
entityManager.clear();
GlobalDiscoveryEntryPersisted persisted = entityManager.find(GlobalDiscoveryEntryPersisted.class, testGlobalDiscoveryEntry.getParticipantId());
assertNotNull(persisted);
assertEquals((Long) initialLastSeen, persisted.getLastSeenDateMs());
Thread.sleep(1L);
subject.touch(TOPIC_NAME);
entityManager.flush();
entityManager.clear();
persisted = entityManager.find(GlobalDiscoveryEntryPersisted.class, testGlobalDiscoveryEntry.getParticipantId());
assertNotNull(persisted);
assertTrue(initialLastSeen < persisted.getLastSeenDateMs());
}
Aggregations