Готовая 3 лабораторная, добавление манги читателю дурацкое
This commit is contained in:
parent
f1a90f39c0
commit
8a595455d6
@ -17,8 +17,8 @@ public class Creator {
|
||||
@Column
|
||||
private String hashedPassword;
|
||||
|
||||
@OneToMany(fetch = FetchType.EAGER, mappedBy = "creator")
|
||||
private List<Manga> mangs;
|
||||
@OneToMany(fetch = FetchType.EAGER, mappedBy = "creator", cascade = CascadeType.REMOVE)
|
||||
private List<Manga> mangas;
|
||||
|
||||
public Creator() {
|
||||
}
|
||||
@ -26,15 +26,15 @@ public class Creator {
|
||||
public Creator(String creatorName, String hashedPassword) {
|
||||
this.creatorName = creatorName;
|
||||
this.hashedPassword = hashedPassword;
|
||||
this.mangs = new ArrayList<>();
|
||||
this.mangas = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public List<Manga> getMangs() {
|
||||
return mangs;
|
||||
public List<Manga> getMangas() {
|
||||
return mangas;
|
||||
}
|
||||
|
||||
public String getCreatorName() {
|
||||
@ -45,8 +45,8 @@ public class Creator {
|
||||
return hashedPassword;
|
||||
}
|
||||
|
||||
public void setMangs(List<Manga> mangs) {
|
||||
this.mangs = mangs;
|
||||
public void setMangas(List<Manga> mangas) {
|
||||
this.mangas = mangas;
|
||||
}
|
||||
|
||||
public void setCreatorName(String creatorName) {
|
||||
|
85
src/main/java/com/LabWork/app/student/model/Manga.java
Normal file
85
src/main/java/com/LabWork/app/student/model/Manga.java
Normal file
@ -0,0 +1,85 @@
|
||||
package com.LabWork.app.student.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
public class Manga {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column
|
||||
private String mangaName;
|
||||
|
||||
@Column
|
||||
private Integer chapterCount;
|
||||
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
@JoinColumn(name="creator_fk")
|
||||
private Creator creator;
|
||||
|
||||
@ManyToMany(fetch = FetchType.EAGER)
|
||||
@JoinTable(name = "mangs_readers",
|
||||
joinColumns = @JoinColumn(name = "manga_fk"),
|
||||
inverseJoinColumns = @JoinColumn(name = "user_fk"))
|
||||
private List<Reader> readers;
|
||||
|
||||
public Manga() {
|
||||
}
|
||||
|
||||
public Manga(Creator creator, String mangaName, Integer chapterCount) {
|
||||
this.creator = creator;
|
||||
this.mangaName = mangaName;
|
||||
this.chapterCount = chapterCount;
|
||||
this.readers = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getMangaName() {
|
||||
return mangaName;
|
||||
}
|
||||
|
||||
public void setMangaName(String mangaName) {
|
||||
this.mangaName = mangaName;
|
||||
}
|
||||
|
||||
public Integer getChapterCount() {
|
||||
return chapterCount;
|
||||
}
|
||||
|
||||
public void setChapterCount(Integer chapterCount) {
|
||||
this.chapterCount = chapterCount;
|
||||
}
|
||||
|
||||
public Creator getCreator() {
|
||||
return creator;
|
||||
}
|
||||
|
||||
public List<Reader> getReaders() {
|
||||
return readers;
|
||||
}
|
||||
|
||||
public void setReaders(List<Reader> readers) {
|
||||
this.readers = readers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Manga manga = (Manga) o;
|
||||
return Objects.equals(id, manga.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
63
src/main/java/com/LabWork/app/student/model/Reader.java
Normal file
63
src/main/java/com/LabWork/app/student/model/Reader.java
Normal file
@ -0,0 +1,63 @@
|
||||
package com.LabWork.app.student.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
public class Reader {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@Column
|
||||
private String readerName;
|
||||
|
||||
@Column
|
||||
private String hashedPassword;
|
||||
|
||||
@ManyToMany(mappedBy = "readers", fetch = FetchType.EAGER)
|
||||
private List<Manga> mangas;
|
||||
|
||||
public Reader() {
|
||||
}
|
||||
|
||||
public Reader(String readerName, String hashedPassword) {
|
||||
this.readerName = readerName;
|
||||
this.hashedPassword = hashedPassword;
|
||||
this.mangas = new ArrayList<>();
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getReaderName() { return readerName; }
|
||||
|
||||
public void setReaderName(String readerName) { this.readerName = readerName; }
|
||||
|
||||
public String getHashedPassword() { return hashedPassword; }
|
||||
|
||||
public void setHashedPassword(String hashedPassword) { this.hashedPassword = hashedPassword; }
|
||||
|
||||
public List<Manga> getMangas() { return mangas; }
|
||||
|
||||
public void setMangas(List<Manga> mangs) { this.mangas = mangs; }
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Reader reader = (Reader) o;
|
||||
return Objects.equals(id, reader.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
@ -9,6 +9,7 @@ import jakarta.transaction.Transactional;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@ -31,22 +32,22 @@ public class CreatorService {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Creator addCreator(String username, String password) {
|
||||
if (!StringUtils.hasText(username) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Creator's username or password is empty");
|
||||
public Creator addCreator(String readername, String password) {
|
||||
if (!StringUtils.hasText(readername) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Creator's readername or password is empty");
|
||||
}
|
||||
final Creator creator = new Creator(username, password);
|
||||
final Creator creator = new Creator(readername, password);
|
||||
em.persist(creator);
|
||||
return creator;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Creator updateCreator(Long id, String username, String password) {
|
||||
if (!StringUtils.hasText(username) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Creator's username or password is empty");
|
||||
public Creator updateCreator(Long id, String readername, String password) {
|
||||
if (!StringUtils.hasText(readername) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Creator's readername or password is empty");
|
||||
}
|
||||
final Creator customer = findCreator(id);
|
||||
customer.setCreatorName(username);
|
||||
customer.setCreatorName(readername);
|
||||
customer.setHashedPassword(password);
|
||||
return em.merge(customer);
|
||||
}
|
||||
@ -61,5 +62,16 @@ public class CreatorService {
|
||||
@Transactional
|
||||
public void deleteAllCreators() {
|
||||
em.createQuery("delete from Creator").executeUpdate();
|
||||
/* List<Creator> creatorList = em.createQuery("select s from Creator s", Creator.class).getResultList();
|
||||
List<Manga> mangaList = new ArrayList<>();*/
|
||||
/* for (Creator creator: creatorList){
|
||||
mangaList.addAll(creator.getMangas());
|
||||
}*/
|
||||
/* for (Manga manga: mangaList){
|
||||
manga.getReaders().remove(manga);
|
||||
}*/
|
||||
/* for (Creator creator: creatorList){
|
||||
creator.getMangas().clear();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.LabWork.app.student.service;
|
||||
|
||||
import com.LabWork.app.student.model.Creator;
|
||||
import com.LabWork.app.student.model.Manga;
|
||||
import com.LabWork.app.student.model.User;
|
||||
import com.LabWork.app.student.model.Reader;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
@ -27,7 +27,7 @@ public class MangaService {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Manga> findAllMangs() {
|
||||
public List<Manga> findAllMangas() {
|
||||
return em.createQuery("select c from Manga c", Manga.class).getResultList();
|
||||
}
|
||||
|
||||
@ -42,8 +42,8 @@ public class MangaService {
|
||||
if (!StringUtils.hasText(mangaName)) {
|
||||
throw new IllegalArgumentException("Invalid mangaName");
|
||||
}
|
||||
final Manga manga = new Manga(chapterCount, mangaName, creator);
|
||||
manga.getCreator().getMangs().add(manga);
|
||||
final Manga manga = new Manga(creator, mangaName, chapterCount);
|
||||
manga.getCreator().getMangas().add(manga);
|
||||
em.persist(manga);
|
||||
return manga;
|
||||
}
|
||||
@ -61,10 +61,6 @@ public class MangaService {
|
||||
@Transactional
|
||||
public Manga deleteManga(Long id) {
|
||||
final Manga currentManga = findManga(id);
|
||||
List<User> userList= currentManga.getUsers();
|
||||
for (User user : userList) {
|
||||
user.getMangs().remove(currentManga);
|
||||
}
|
||||
em.remove(currentManga);
|
||||
return currentManga;
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
package com.LabWork.app.student.service;
|
||||
|
||||
import com.LabWork.app.student.model.Manga;
|
||||
import com.LabWork.app.student.model.Reader;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import jakarta.transaction.Transactional;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ReaderService {
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
@Transactional
|
||||
public Reader findReader(Long id) {
|
||||
final Reader reader = em.find(Reader.class, id);
|
||||
if (reader == null) {
|
||||
throw new EntityNotFoundException(String.format("Reader with id [%s] is not found", id));
|
||||
}
|
||||
return reader;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<Reader> findAllReaders() {
|
||||
return em.createQuery("select c from Reader c", Reader.class).getResultList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Reader addReader(String readername, String password) {
|
||||
if (!StringUtils.hasText(readername) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Customer's readername or password is empty");
|
||||
}
|
||||
final Reader reader = new Reader(readername, password);
|
||||
em.persist(reader);
|
||||
return reader;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void addManga(Manga manga, Reader reader) {
|
||||
if (manga == null || reader == null) {
|
||||
throw new IllegalArgumentException("manga or reader null");
|
||||
}
|
||||
reader.getMangas().add(manga);
|
||||
em.merge(manga);
|
||||
manga.getReaders().add(reader);
|
||||
em.merge(reader);
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Reader updateReader(Long id, String readername, String password) {
|
||||
if (!StringUtils.hasText(readername) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Customer's readername or password is empty");
|
||||
}
|
||||
final Reader reader = findReader(id);
|
||||
reader.setReaderName(readername);
|
||||
reader.setHashedPassword(password);
|
||||
return reader;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public Reader deleteReader(Long id) {
|
||||
final Reader currentCustomer = findReader(id);
|
||||
em.remove(currentCustomer);
|
||||
return currentCustomer;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteAllReaders() {
|
||||
em.createQuery("delete from Reader").executeUpdate();
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
package com.LabWork.app.student.service;
|
||||
|
||||
import com.LabWork.app.student.model.User;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.EntityNotFoundException;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import jakarta.transaction.Transactional;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
@PersistenceContext
|
||||
private EntityManager em;
|
||||
|
||||
@Transactional
|
||||
public User findUser(Long id) {
|
||||
final User user = em.find(User.class, id);
|
||||
if (user == null) {
|
||||
throw new EntityNotFoundException(String.format("User with id [%s] is not found", id));
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<User> findAllUsers() {
|
||||
return em.createQuery("select c from User c", User.class).getResultList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public User addUser(String username, String password) {
|
||||
if (!StringUtils.hasText(username) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Customer's username or password is empty");
|
||||
}
|
||||
final User user = new User(username, password);
|
||||
em.persist(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public User updateUser(Long id, String username, String password) {
|
||||
if (!StringUtils.hasText(username) || !StringUtils.hasText(password)) {
|
||||
throw new IllegalArgumentException("Customer's username or password is empty");
|
||||
}
|
||||
final User user = findUser(id);
|
||||
user.setUserName(username);
|
||||
user.setHashedPassword(password);
|
||||
return em.merge(user);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public User deleteUser(Long id) {
|
||||
final User currentCustomer = findUser(id);
|
||||
em.remove(currentCustomer);
|
||||
return currentCustomer;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteAllUsers() {
|
||||
em.createQuery("delete from User").executeUpdate();
|
||||
}
|
||||
}
|
@ -2,13 +2,16 @@ package com.LabWork.app;
|
||||
|
||||
import com.LabWork.app.student.model.Creator;
|
||||
import com.LabWork.app.student.model.Manga;
|
||||
import com.LabWork.app.student.model.Reader;
|
||||
import com.LabWork.app.student.service.CreatorService;
|
||||
import com.LabWork.app.student.service.MangaService;
|
||||
import com.LabWork.app.student.service.UserService;
|
||||
import com.LabWork.app.student.service.ReaderService;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SpringBootTest
|
||||
public class ReMangaTest {
|
||||
@ -19,13 +22,15 @@ public class ReMangaTest {
|
||||
MangaService mangaService;
|
||||
|
||||
@Autowired
|
||||
UserService userService;
|
||||
ReaderService readerService;
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ReMangaTest.class);
|
||||
|
||||
@Test
|
||||
void testCreator() {
|
||||
creatorService.deleteAllCreators();
|
||||
readerService.deleteAllReaders();
|
||||
mangaService.deleteAllMangs();
|
||||
userService.deleteAllUsers();
|
||||
creatorService.deleteAllCreators();
|
||||
|
||||
Creator c1 = creatorService.addCreator("first", "1");
|
||||
Creator c2 = creatorService.addCreator("second", "2");
|
||||
@ -46,78 +51,92 @@ public class ReMangaTest {
|
||||
Assertions.assertNotEquals(c3.getCreatorName(), c4.getCreatorName());
|
||||
Assertions.assertNotEquals(c3.getHashedPassword(), c4.getHashedPassword());
|
||||
|
||||
creatorService.deleteAllCreators();
|
||||
readerService.deleteAllReaders();
|
||||
mangaService.deleteAllMangs();
|
||||
userService.deleteAllUsers();
|
||||
creatorService.deleteAllCreators();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testManga() {
|
||||
creatorService.deleteAllCreators();
|
||||
readerService.deleteAllReaders();
|
||||
mangaService.deleteAllMangs();
|
||||
userService.deleteAllUsers();
|
||||
creatorService.deleteAllCreators();
|
||||
|
||||
Creator c1 = creatorService.addCreator("first", "1");
|
||||
Creator c2 = creatorService.addCreator("second", "2");
|
||||
|
||||
Manga p1 = mangaService.addManga(c1, 0, "Vagrant");
|
||||
Manga p2 = mangaService.addManga(c2, 10, "Berserk");
|
||||
Manga m1 = mangaService.addManga(c1, 0, "vagabond");
|
||||
Manga m2 = mangaService.addManga(c2, 10, "Berserk");
|
||||
|
||||
Assertions.assertEquals(2, mangaService.findAllMangs().size());
|
||||
Assertions.assertEquals(2, mangaService.findAllMangas().size());
|
||||
|
||||
Assertions.assertEquals(p1.getCreator(), c1);
|
||||
Assertions.assertEquals(p2.getCreator(), c2);
|
||||
Assertions.assertEquals(m1.getCreator(), c1);
|
||||
Assertions.assertEquals(m2.getCreator(), c2);
|
||||
|
||||
Assertions.assertEquals(c1.getMangs().get(0), p1);
|
||||
Assertions.assertEquals(c2.getMangs().get(0), p2);
|
||||
Assertions.assertEquals(c1.getMangas().get(0), m1);
|
||||
Assertions.assertEquals(c2.getMangas().get(0), m2);
|
||||
|
||||
Assertions.assertEquals(p1, mangaService.findManga(p1.getId()));
|
||||
Assertions.assertEquals(p2, mangaService.findManga(p2.getId()));
|
||||
Assertions.assertEquals(m1, mangaService.findManga(m1.getId()));
|
||||
Assertions.assertEquals(m2, mangaService.findManga(m2.getId()));
|
||||
|
||||
Manga p3 = mangaService.addManga(c1, 10, "Solo Leveling");
|
||||
mangaService.deleteManga(p1.getId());
|
||||
Assertions.assertEquals(1, creatorService.findCreator(c1.getId()).getMangs().size());
|
||||
Manga test_manga = mangaService.deleteManga(m1.getId());
|
||||
log.info(test_manga.toString());
|
||||
log.info(test_manga.getMangaName());
|
||||
log.info(creatorService.findCreator(c1.getId()).getMangas().toString());
|
||||
Assertions.assertEquals(1, creatorService.findCreator(c1.getId()).getMangas().size());
|
||||
|
||||
Manga p4 = mangaService.updateManga(p2.getId(), 100);
|
||||
Manga p4 = mangaService.updateManga(m2.getId(), 100);
|
||||
|
||||
Assertions.assertNotEquals(p2.getChapterCount(), p4.getChapterCount());
|
||||
Assertions.assertNotEquals(m2.getChapterCount(), p4.getChapterCount());
|
||||
|
||||
creatorService.deleteAllCreators();
|
||||
readerService.deleteAllReaders();
|
||||
mangaService.deleteAllMangs();
|
||||
userService.deleteAllUsers();
|
||||
creatorService.deleteAllCreators();
|
||||
|
||||
}
|
||||
|
||||
/* @Test
|
||||
void testUser() {
|
||||
creatorService.deleteAllCreators();
|
||||
@Test
|
||||
void testreader() {
|
||||
readerService.deleteAllReaders();
|
||||
mangaService.deleteAllMangs();
|
||||
userService.deleteAllUsers();
|
||||
|
||||
Creator c1 = creatorService.addCreator("first", "1");
|
||||
Creator c2 = creatorService.addCreator("second", "2");
|
||||
|
||||
Post p1 = postService.addPost(c1, "first title", "nonsense");
|
||||
Post p2 = postService.addPost(c2, "second title", "ordinal");
|
||||
|
||||
Assertions.assertEquals(2, postService.findAllPosts().size());
|
||||
|
||||
User com1 = commentService.addComment(c1, p2, "What");
|
||||
User com2 = commentService.addComment(c2, p1, "How");
|
||||
|
||||
Assertions.assertEquals(c1, p2.getComments().get(0).getCustomer());
|
||||
Assertions.assertEquals(c2, p1.getComments().get(0).getCustomer());
|
||||
|
||||
Comment com3 = commentService.addComment(c1, p1, "Really");
|
||||
|
||||
Assertions.assertEquals(com2, commentService.findComment(p1.getComments().get(0).getId()));
|
||||
|
||||
Comment com4 = commentService.updateComment(com3.getId(), "Not really");
|
||||
|
||||
Assertions.assertNotEquals(com3.getContent(), com4.getContent());
|
||||
Assertions.assertEquals(com3.getCustomer().getId(), com4.getCustomer().getId());
|
||||
|
||||
creatorService.deleteAllCreators();
|
||||
|
||||
|
||||
Creator c1 = creatorService.addCreator("first_C", "1");
|
||||
Creator c2 = creatorService.addCreator("second_C", "2");
|
||||
|
||||
Manga m1 = mangaService.addManga(c1, 0, "vagabond");
|
||||
Manga m2 = mangaService.addManga(c2, 10, "Berserk");
|
||||
|
||||
Assertions.assertEquals(2, mangaService.findAllMangas().size());
|
||||
|
||||
Reader r1 = readerService.addReader("first_R", "1");
|
||||
Reader r2 = readerService.addReader("second_R", "2");
|
||||
log.info("ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ");
|
||||
readerService.addManga(m1, r1);
|
||||
readerService.addManga(m2, r2);
|
||||
log.info(r1.getMangas().get(0).getCreator().toString());
|
||||
log.info(c1.toString());
|
||||
Assertions.assertEquals(c1, r1.getMangas().get(0).getCreator());
|
||||
Assertions.assertEquals(c2, r2.getMangas().get(0).getCreator());
|
||||
|
||||
|
||||
Reader r3 = readerService.addReader("third_R", "3");
|
||||
|
||||
log.info(m1.getReaders().toString());
|
||||
log.info(c1.getId().toString());
|
||||
log.info("ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ ХУЙ");
|
||||
Assertions.assertEquals(r1, m1.getReaders().get(0));
|
||||
|
||||
Reader r4 = readerService.updateReader(r3.getId(), "fourth_R", "3");
|
||||
|
||||
Assertions.assertNotEquals(r3.getReaderName(), r4.getReaderName());
|
||||
Assertions.assertEquals(r3.getHashedPassword(), r4.getHashedPassword());
|
||||
|
||||
|
||||
readerService.deleteAllReaders();
|
||||
mangaService.deleteAllMangs();
|
||||
userService.deleteAllUsers();
|
||||
}*/
|
||||
creatorService.deleteAllCreators();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user