Search in sources :

Example 1 with LWM2MQuery

use of org.eclipse.vorto.repository.web.core.dto.LWM2MQuery in project vorto by eclipse.

the class Lwm2mObjectIdResolverTest method testResolveResourceId.

@Test
public void testResolveResourceId() {
    importModel("lwm2m/ColorLight.fbmodel");
    importModel("lwm2m/ColorLight_lwm2m.mapping");
    DefaultResolver lwm2mResolver = new DefaultResolver();
    lwm2mResolver.setRepositoryFactory(repositoryFactory);
    lwm2mResolver.setSearchService(searchService);
    assertNull(lwm2mResolver.resolve(new LWM2MQuery("3")));
}
Also used : DefaultResolver(org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver) LWM2MQuery(org.eclipse.vorto.repository.web.core.dto.LWM2MQuery) Test(org.junit.Test)

Example 2 with LWM2MQuery

use of org.eclipse.vorto.repository.web.core.dto.LWM2MQuery in project vorto by eclipse.

the class Lwm2mObjectIdResolverTest method testResolveForExistingObjectId.

@Test
public void testResolveForExistingObjectId() {
    importModel("lwm2m/ColorLight.fbmodel");
    importModel("lwm2m/ColorLight_lwm2m.mapping");
    DefaultResolver lwm2mResolver = new DefaultResolver();
    lwm2mResolver.setRepositoryFactory(repositoryFactory);
    lwm2mResolver.setSearchService(searchService);
    assertEquals(new ModelId("ColorLight", "com.mycompany.fb", "1.0.0"), lwm2mResolver.resolve(new LWM2MQuery("2")));
    assertNotNull(repositoryFactory.getRepository(createUserContext("admin")).getById(lwm2mResolver.resolve(new LWM2MQuery("2"))));
}
Also used : DefaultResolver(org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver) LWM2MQuery(org.eclipse.vorto.repository.web.core.dto.LWM2MQuery) ModelId(org.eclipse.vorto.model.ModelId) Test(org.junit.Test)

Aggregations

DefaultResolver (org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver)2 LWM2MQuery (org.eclipse.vorto.repository.web.core.dto.LWM2MQuery)2 Test (org.junit.Test)2 ModelId (org.eclipse.vorto.model.ModelId)1