@Test
@SuppressWarnings({"unchecked"})
public void testBatchDelete() throws Exception
{
ResourceModel statusResourceModel = buildResourceModel(StatusCollectionResource.class);
ResourceModel discoveredItemsResourceModel = buildResourceModel(DiscoveredItemsResource.class);
ResourceMethodDescriptor methodDescriptor;
StatusCollectionResource statusResource;
DiscoveredItemsResource discoveredItemsResource;
// #1 Batch delete on collection resource
methodDescriptor = statusResourceModel.findMethod(ResourceMethod.BATCH_DELETE);
statusResource = getMockResource(StatusCollectionResource.class);
@SuppressWarnings("rawtypes")
BatchDeleteRequest batchDeleteRequest =(BatchDeleteRequest)EasyMock.anyObject();
EasyMock.expect(statusResource.batchDelete(batchDeleteRequest)).andReturn(null).once();
checkInvocation(statusResource,
methodDescriptor,
"DELETE",
version,
"/statuses?ids=List(1,2)",
"",
buildBatchPathKeys(1L, 2L));
// #2 Batch delete on complex-key resource
methodDescriptor = discoveredItemsResourceModel.findMethod(ResourceMethod.BATCH_DELETE);
discoveredItemsResource = getMockResource(DiscoveredItemsResource.class);
ComplexResourceKey<DiscoveredItemKey, DiscoveredItemKeyParams> keyA =
getDiscoveredItemComplexKey(1L, 2, 3L);
ComplexResourceKey<DiscoveredItemKey, DiscoveredItemKeyParams> keyB =
getDiscoveredItemComplexKey(4L, 5, 6L);