Search in sources :

Example 6 with MetadataDTO

use of org.eclipse.smarthome.core.items.dto.MetadataDTO in project smarthome by eclipse.

the class ItemResourceOSGiTest method testMetadata.

@Test
public void testMetadata() {
    MetadataDTO dto = new MetadataDTO();
    dto.value = "some value";
    assertEquals(201, itemResource.addMetadata(ITEM_NAME1, "namespace", dto).getStatus());
    assertEquals(200, itemResource.removeMetadata(ITEM_NAME1, "namespace").getStatus());
    assertEquals(404, itemResource.removeMetadata(ITEM_NAME1, "namespace").getStatus());
}
Also used : MetadataDTO(org.eclipse.smarthome.core.items.dto.MetadataDTO) JavaOSGiTest(org.eclipse.smarthome.test.java.JavaOSGiTest) Test(org.junit.Test)

Aggregations

MetadataDTO (org.eclipse.smarthome.core.items.dto.MetadataDTO)6 JavaOSGiTest (org.eclipse.smarthome.test.java.JavaOSGiTest)5 Test (org.junit.Test)5 Response (javax.ws.rs.core.Response)3 JsonObject (com.google.gson.JsonObject)1 HashMap (java.util.HashMap)1 Metadata (org.eclipse.smarthome.core.items.Metadata)1 MetadataKey (org.eclipse.smarthome.core.items.MetadataKey)1 EnrichedGroupItemDTO (org.eclipse.smarthome.io.rest.core.item.EnrichedGroupItemDTO)1 EnrichedItemDTO (org.eclipse.smarthome.io.rest.core.item.EnrichedItemDTO)1