💾 Setup SQLite database (#3)
* Add SQLite setup * Add basic user entity and repository * Adjust DB naming * Consolidate properties
This commit is contained in:
parent
254f2f09ec
commit
e75ac48743
7 changed files with 141 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
package de.mlessmann.certassist.repositories;
|
||||
|
||||
import de.mlessmann.certassist.models.User;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@SpringBootTest
|
||||
class UserRepositoryTest {
|
||||
|
||||
@Autowired
|
||||
private UserRepository userRepository;
|
||||
|
||||
@Test
|
||||
void findUserById() {
|
||||
final User user = new User();
|
||||
user.setUsername("test");
|
||||
userRepository.save(user);
|
||||
|
||||
assertThat(userRepository.findUserById(user.getId()).getUsername()).isEqualTo("test");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue