//
// produkDaoTest.java
// produk-api-service 
//
// Created by Agung Pramono on 23/10/2016 
// Copyright (c) 2016 Java Development. All rights reserved.
//

package com.agung.produk.dao;

import com.agung.produk.ProdukApiApplication;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = ProdukApiApplication.class)
@Transactional
@Sql(scripts = {"/mysql/delete-data.sql","/mysql/sample-produk.sql"})
public class produkDaoTest {

}

@@ -240,32 +240,211 @@
 ort 
-org.junit.runner.RunWith
+com.agung.produk.entity.Produk;%0Aimport java.math.BigDecimal;%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired
 ;%0Aim
@@ -934,10 +934,358 @@
 Test %7B%0A%0A
+    @Autowired%0A    private ProdukDao pd;%0A    %0A    @Test%0A    public void testSimpan()%7B%0A        Produk p = new Produk();%0A        %0A        p.setCode(%22p-001%22);%0A        p.setName(%22Produk-001%22);%0A        p.setPrice(new BigDecimal(36000.0));%0A        %0A        Assert.assertNull(p.getId());%0A        pd.save(p);%0A        Assert.assertNotNull(p.getId());%0A    %7D%0A
 %7D%0A

add test class