Search in sources :

Example 1 with DocumentWrapperTransformer

use of ru.ydn.wicket.wicketorientdb.utils.DocumentWrapperTransformer in project wicket-orientdb by OrienteerBAP.

the class MainUtilsTest method testDocumentWrapper.

@Test
public void testDocumentWrapper() throws Exception {
    // Admin ORID
    ORID orid = new ORecordId("#5:0");
    ODocument adminDocument = orid.getRecord();
    OUser admin = wicket.getTester().getMetadata().getSecurity().getUser("admin");
    DocumentWrapperTransformer<OUser> transformer = new DocumentWrapperTransformer<OUser>(OUser.class);
    assertEquals(admin, transformer.apply(adminDocument));
}
Also used : DocumentWrapperTransformer(ru.ydn.wicket.wicketorientdb.utils.DocumentWrapperTransformer) ORID(com.orientechnologies.orient.core.id.ORID) OUser(com.orientechnologies.orient.core.metadata.security.OUser) ORecordId(com.orientechnologies.orient.core.id.ORecordId) ODocument(com.orientechnologies.orient.core.record.impl.ODocument) Test(org.junit.Test)

Aggregations

ORID (com.orientechnologies.orient.core.id.ORID)1 ORecordId (com.orientechnologies.orient.core.id.ORecordId)1 OUser (com.orientechnologies.orient.core.metadata.security.OUser)1 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)1 Test (org.junit.Test)1 DocumentWrapperTransformer (ru.ydn.wicket.wicketorientdb.utils.DocumentWrapperTransformer)1