use of org.sagebionetworks.bridge.models.Tag in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onMerge.
@Test
public void onMerge() throws HibernateException {
MergeEvent event = new MergeEvent(new Tag("value"), null);
event.setEntity(new Tag("value"));
listener.onMerge(event);
verify(cacheProvider).removeObject(CacheKey.tagList());
}
use of org.sagebionetworks.bridge.models.Tag in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onSaveOrUpdate.
@Test
public void onSaveOrUpdate() throws HibernateException {
SaveOrUpdateEvent event = new SaveOrUpdateEvent(new Tag("value"), null);
listener.onSaveOrUpdate(event);
verify(cacheProvider).removeObject(CacheKey.tagList());
}
use of org.sagebionetworks.bridge.models.Tag in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onPersistWithCreatedMap.
@Test
public void onPersistWithCreatedMap() throws HibernateException {
PersistEvent event = new PersistEvent(new Tag("value"), null);
listener.onPersist(event, null);
verify(cacheProvider).removeObject(CacheKey.tagList());
}
use of org.sagebionetworks.bridge.models.Tag in project BridgeServer2 by Sage-Bionetworks.
the class TagEventListenerTest method onDelete.
@Test
public void onDelete() throws HibernateException {
DeleteEvent event = new DeleteEvent(new Tag("value"), null);
listener.onDelete(event);
verify(cacheProvider).removeObject(CacheKey.tagList());
}
use of org.sagebionetworks.bridge.models.Tag in project BridgeServer2 by Sage-Bionetworks.
the class HibernateTagDaoTest method getTags.
@Test
public void getTags() {
List<Tag> list = ImmutableList.of(new Tag("a:1"), new Tag("a:2"), new Tag("a:3"), new Tag("a:4"), new Tag("a:5"), new Tag("b:6"), new Tag("b:7"), new Tag("b:8"), new Tag("b:9"), new Tag("b:0"), new Tag("a:10"), new Tag("defaultTag"));
when(mockHelper.queryGet("from Tag", null, null, null, Tag.class)).thenReturn(list);
Map<String, List<String>> retValue = dao.getTags();
assertEquals(3, retValue.keySet().size());
assertEquals(ImmutableList.of("defaultTag"), retValue.get("default"));
assertEquals(ImmutableList.of("1", "2", "3", "4", "5", "10"), retValue.get("a"));
assertEquals(ImmutableList.of("6", "7", "8", "9", "0"), retValue.get("b"));
}
Aggregations