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")));
}
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"))));
}
Aggregations