package pl.java.scalatech.test;

import java.math.BigDecimal;
import java.util.List;

import org.fest.assertions.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import pl.java.scalatech.app.JpaKataApplication;
import pl.java.scalatech.config.JpaConfig;
import pl.java.scalatech.entity.Customer;
import pl.java.scalatech.repository.CustomerRepository;

/**
 * @author przodownik
 *         Module name : JpaKata
 *         Creating time : 30 maj 2014
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = { JpaKataApplication.class, JpaConfig.class })
@ActiveProfiles(value="dev")
public class ApplicationTests {
    @Autowired
    private CustomerRepository customerRepository;

    @Test
    public void contextLoads() {
        Assertions.assertThat(true);
    }

    @Test
    public void shouldInsertAndRetrieveData() throws InterruptedException {
        customerRepository.save(Customer.builder().login("przodownik").name("slawek").salary(new BigDecimal(2342)).build());
        List<Customer> customers = customerRepository.findAll();
        "d".getBytes();
        Assertions.assertThat(customers).isNotEmpty().hasSize(1);
        Thread.sleep(100000);
    }
}

@@ -302,24 +302,86 @@
 figuration;%0A
+import org.springframework.context.annotation.PropertySource;%0A
 import org.s
@@ -495,16 +495,81 @@
 sRunner;
+%0Aimport org.springframework.transaction.annotation.Transactional;
 %0A%0Aimport
@@ -938,17 +938,16 @@
 sses = %7B
- 
 JpaKataA
@@ -963,16 +963,17 @@
 n.class,
+ 
  JpaConf
@@ -1013,16 +1013,31 @@
 =%22dev%22)%0A
+@Transactional%0A
 public c

test profile