// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java
// public class Foo {
// 
//   private String name;
// 
//   public String getName() {
//     return name;
//   }
// 
//   public void setName(String name) {
//     this.name = name;
//   }
// }
// 
// Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java
// public interface FooRepository {
// 
//   void save(Foo foo);
// 
//   void delete(String name);
// 
// }


import me.chanjar.domain.Foo;
import me.chanjar.domain.FooRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
package me.chanjar.spring2;



@ContextConfiguration(classes = Spring_2_IT_Configuration.class)
public class Spring_2_IT extends AbstractTransactionalTestNGSpringContextTests {

  @Autowired
  private FooRepository fooRepository;

  @Test
  public void testSave() {

    Foo foo = new Foo();
    foo.setName("Bob");
    fooRepository.save(foo);

    assertEquals(countRowsInTable("FOO"), 1);
    countRowsInTableWhere("FOO", "name = 'Bob'");
  }

  @Test(dependsOnMethods = "testSave")
  public void testDelete() {

    assertEquals(countRowsInTable("FOO"), 0);

// Path: rdbs/src/main/java/me/chanjar/domain/Foo.java
// public class Foo {
// 
//   private String name;
// 
//   public String getName() {
//     return name;
//   }
// 
//   public void setName(String name) {
//     this.name = name;
//   }
// }
// 
// Path: rdbs/src/main/java/me/chanjar/domain/FooRepository.java
// public interface FooRepository {
// 
//   void save(Foo foo);
// 
//   void delete(String name);
// 
// }


// Path: rdbs/src/test/java/me/chanjar/spring2/Spring_2_IT.java
import me.chanjar.domain.Foo;
import me.chanjar.domain.FooRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;

package me.chanjar.spring2;



@ContextConfiguration(classes = Spring_2_IT_Configuration.class)
public class Spring_2_IT extends AbstractTransactionalTestNGSpringContextTests {

  @Autowired
  private FooRepository fooRepository;

  @Test
  public void testSave() {

    Foo foo = new Foo();
    foo.setName("Bob");
    fooRepository.save(foo);

    assertEquals(countRowsInTable("FOO"), 1);
    countRowsInTableWhere("FOO", "name = 'Bob'");
  }

  @Test(dependsOnMethods = "testSave")
  public void testDelete() {

    assertEquals(countRowsInTable("FOO"), 0);

    Foo foo = new Foo();