@Test(expected = BadRequestException.class)
public void testDeleteProductWithSubscriptions() {
ProductServiceAdapter pa = mock(ProductServiceAdapter.class);
I18n i18n = I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK);
ProductResource pr = new ProductResource(pa, null, null, null, i18n);
Product p = mock(Product.class);
when(pa.getProductById(eq("10"))).thenReturn(p);
Set<Subscription> subs = new HashSet<Subscription>();
Subscription s = mock(Subscription.class);
subs.add(s);
when(pa.productHasSubscriptions(eq(p))).thenReturn(true);
pr.deleteProduct("10");
}