package com.goree.api.util;

import org.dbunit.dataset.IDataSet;
import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.goree.api.Application;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes={Application.class})
public abstract class TestWithDBUnit {
    @Autowired
    private DBUnitOperator operator;
    
	@Before
	public void setUp() {
		IDataSet dataset = IDataSetFactory.fromXml(getDatasetFilePath());
		operator.cleanInsert(dataset);
	}
	
	@After
	public void tearDown() {
	    IDataSet dataset = IDataSetFactory.fromXml(getDatasetFilePath());
        operator.deleteAll(dataset);
	}
	
	public abstract String getDatasetFilePath();
	
}

@@ -22,16 +22,50 @@
 .util;%0A%0A
+import com.goree.api.Application;%0A
 import o
@@ -383,43 +383,8 @@
 r;%0A%0A
-import com.goree.api.Application;%0A%0A
 @Run
@@ -575,47 +575,24 @@
 or;%0A
-    %0A%09@Before%0A%09public void setUp() %7B%0A%09%09
+%0A%09private final 
 IDat
@@ -652,16 +652,50 @@
 Path());
+;%0A%0A%09@Before%0A%09public void setUp() %7B
 %0A%09%09opera
@@ -763,79 +763,8 @@
 ) %7B%0A
-%09    IDataSet dataset = IDataSetFactory.fromXml(getDatasetFilePath());%0A
     
@@ -803,21 +803,24 @@
 %0A%09%7D%0A%09%0A%09p
-ublic
+rotected
  abstrac

Optimize DBUnitTest