@@ -0,0 +1,1318 @@
+package prueba;%0D%0Aimport static org.junit.Assert.*;%0D%0Aimport org.junit.Before;%0D%0Aimport org.junit.Test;%0D%0Aimport org.junit.runner.RunWith;%0D%0Aimport org.springframework.beans.factory.annotation.Autowired;%0D%0Aimport org.springframework.boot.test.IntegrationTest;%0D%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0D%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0D%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0D%0Aimport aplication.Application;%0D%0Aimport aplication.domain.User;%0D%0Aimport aplication.service.DBManagement;%0D%0A%0D%0A@RunWith(SpringJUnit4ClassRunner.class)%0D%0A@SpringApplicationConfiguration(classes = Application.class)%0D%0A@WebAppConfiguration%0D%0A@IntegrationTest(%7B%22server.port=0%22%7D)%0D%0Apublic class DBTest %7B%0D%0A%0D%0A%09@Autowired%0D%0A%09DBManagement manager;%0D%0A%09%0D%0A%09@Before%0D%0A%09public void setUp() throws Exception %7B%0D%0A%09%09manager.save(new User(%22test@gmail.com%22, %22test%22));%0D%0A%09%09%7D%0D%0A%09%0D%0A%09@Test%0D%0A%09public void find()%7B%0D%0A%09%09User user;%0D%0A%09%09%0D%0A%09%09user = manager.findByEmailAndPassword(%22tst@gmail.com%22, %22test%22);%0D%0A%09%09assertNull(user);%0D%0A%09%09%0D%0A%09%09user = manager.findByEmailAndPassword(%22test@gmail.com%22, %22tst%22);%0D%0A%09%09assertNull(user);%0D%0A%09%09%0D%0A%09%09user = manager.findByEmailAndPassword(%22test@gmail.com%22, %22test%22);%0D%0A%09%09assertEquals(%22test@gmail.com%22, user.getEmail());%0D%0A%09%09assertEquals(%22test%22, user.getPassword());%0D%0A%09%09%0D%0A%09%7D%0D%0A%0D%0A%7D

Test ejemplo solo BD