@Test public void testInsert() { logger.info("Testing insertion."); // Test insert a category. String tmpCategory = "Category 05"; CategoryBean category = new CategoryBean(); category.setDescription(String.format("Description of the %s.", tmpCategory)); category.setName(String.format("Name %s.", tmpCategory)); Long idCategory = serviceFactory.getCategoryService().insert(category); // Test insert a product. String tmpProduct = "Product 05"; ProductBean product = new ProductBean(); product.setDescription(String.format("Description of the %s.", tmpProduct)); product.setName(String.format("Name %s.", tmpProduct)); product.setPrice(12.02d); product.setCategory(new CategoryBean(idCategory)); serviceFactory.getProductServices().insert(product); }