Search in sources :

Example 1 with MetadataProvider

use of org.eclipse.smarthome.core.items.MetadataProvider in project smarthome by eclipse.

the class ItemResourceOSGiTest method testRemoveMetadata_unmanagedMetadata.

@Test
public void testRemoveMetadata_unmanagedMetadata() {
    MetadataProvider provider = mock(MetadataProvider.class);
    when(provider.getAll()).thenReturn(Collections.singleton(new Metadata(new MetadataKey("namespace", ITEM_NAME1), "some value", null)));
    registerService(provider);
    Response response = itemResource.removeMetadata(ITEM_NAME1, "namespace");
    assertEquals(409, response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) MetadataProvider(org.eclipse.smarthome.core.items.MetadataProvider) Metadata(org.eclipse.smarthome.core.items.Metadata) MetadataKey(org.eclipse.smarthome.core.items.MetadataKey) JavaOSGiTest(org.eclipse.smarthome.test.java.JavaOSGiTest) Test(org.junit.Test)

Aggregations

Response (javax.ws.rs.core.Response)1 Metadata (org.eclipse.smarthome.core.items.Metadata)1 MetadataKey (org.eclipse.smarthome.core.items.MetadataKey)1 MetadataProvider (org.eclipse.smarthome.core.items.MetadataProvider)1 JavaOSGiTest (org.eclipse.smarthome.test.java.JavaOSGiTest)1 Test (org.junit.Test)1