package devopsdistilled.operp.server.data.repo;

import static org.junit.Assert.assertNotNull;

import javax.inject.Inject;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import devopsdistilled.operp.server.context.AppTestContext;
import devopsdistilled.operp.server.data.entity.Product;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = AppTestContext.class)
@Transactional
public class ProductRepositoryTest {
	/*
	 * @PersistenceContext private EntityManager entityManager;
	 */
	
	@Inject
	ProductRepository productRepository;

	@Before
	public void setUp() throws Exception {
		/*
		 * JpaRepositoryFactory jpaRepositoryFactory = new JpaRepositoryFactory(
		 * entityManager); productRepository = jpaRepositoryFactory
		 * .getRepository(ProductRepository.class);
		 */
		
		assertNotNull(productRepository);
	}

	@Test
	public void testSave() {
		Product testProduct = new Product();
		testProduct.setProductName("Test Product");
		testProduct = productRepository.save(testProduct);
		Assert.assertEquals(testProduct,
				productRepository.findOne(testProduct.getProductId()));
	}

}

@@ -46,55 +46,8 @@
 o;%0A%0A
-import static org.junit.Assert.assertNotNull;%0A%0A
 impo
@@ -70,16 +70,16 @@
 Inject;%0A
+
 %0Aimport 
@@ -495,16 +495,63 @@
 oduct;%0A%0A
+import static org.junit.Assert.assertNotNull;%0A%0A
 @RunWith
@@ -758,18 +758,17 @@
 r;%0A%09 */%0A
-%09
 %0A
+
 %09@Inject
@@ -1050,18 +1050,16 @@
 ;%0A%09%09 */%0A
-%09%09
 %0A%09%09asser

Add some import statements