use of org.eclipse.leshan.client.resource.BaseInstanceEnabler in project leshan by eclipse.
the class LinkFormatHelperTest method encode_client_description_with_version_1_0.
@Test
public void encode_client_description_with_version_1_0() {
List<LwM2mObjectEnabler> objectEnablers = new ArrayList<>();
Map<Integer, LwM2mInstanceEnabler> instancesMap = new HashMap<>();
instancesMap.put(0, new BaseInstanceEnabler());
objectEnablers.add(new ObjectEnabler(6, getObjectModel(6), instancesMap, null));
Link[] links = LinkFormatHelper.getClientDescription(objectEnablers, null);
String strLinks = Link.serialize(links);
assertEquals("</>;rt=\"oma.lwm2m\", </6/0>", strLinks);
}
use of org.eclipse.leshan.client.resource.BaseInstanceEnabler in project leshan by eclipse.
the class LinkFormatHelperTest method encode_client_description_with_version_2_0.
@Test
public void encode_client_description_with_version_2_0() {
List<LwM2mObjectEnabler> objectEnablers = new ArrayList<>();
Map<Integer, LwM2mInstanceEnabler> instancesMap = new HashMap<>();
instancesMap.put(0, new BaseInstanceEnabler());
instancesMap.put(1, new BaseInstanceEnabler());
objectEnablers.add(new ObjectEnabler(6, getVersionedObjectModel(6, "2.0"), instancesMap, null));
Link[] links = LinkFormatHelper.getClientDescription(objectEnablers, null);
String strLinks = Link.serialize(links);
assertEquals("</>;rt=\"oma.lwm2m\", </6>;ver=\"2.0\", </6/0>, </6/1>", strLinks);
}
Aggregations