title: SpringBoot test service (using repository with JDBCTemplate)
body: <p>I'm trying to write a test for one of my services. The service uses autowired repository which uses jdbcTemplate to access the DB. The problem is that the test actually puts data in the real DB.<br>
  Here is my test class:</p>
  
  <pre><code>@SpringApplicationConfiguration(Application.class)
  @SpringBootTest(classes = { UserServiceImpl.class, UserService.class })
  @RunWith(SpringJUnit4ClassRunner.class)
  public class UserServiceTest {
  @Autowired UserService userService;
  
  @Test
  public void test() {
      final String fName = " xxxxxx ";        
  
      User user = new User();
      user.setFirstName(fName);
      user.setLastName(fName);
      user.setEmail(fName);
      user.setLogin(fName);
      user.setPhone(fName);
      userService.create(user);
  
      user = userService.getUserByLogin(fName).get();
      assertEquals(fName, user.getLogin());   
   }
  }
  </code></pre>
  
  <p>Is there anything i can do to prevent the userService to work with real DB and somehow just make a simulation?</p>