Skip to content

Commit

Permalink
[HOTFIX] Fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ahan10 committed Mar 11, 2024
1 parent ceebfa5 commit 096569f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/longbox/persistence/entity/Comment.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Comment(CommentDto c){

public Comment(CommentDto c, User u, ComicBook cb){
this.user = u;
this.userName = c.getUser().getUserName();
this.userName = u.getUserName();
this.comicBook = cb;
this.message = c.getMessage();
this.commentDate = c.getDateAdded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ void init(){
);

comicBookDto2 = new ComicBookDto(
"The Amazing Spider-Man",
"Stan Lee",
"Steve Ditko",
new String[] {"Superhero", "Superpower", "Adventure", "Science Fiction", "Futuristic", "Romance", "Drama"},
"Most famous superhoero of all time",
900,
"Marvel Comics",
1963,
"Sanctuary",
"Sho Fumimura",
"Ryoichi Ikegami",
new String[] {"Polital", "Crime", "Thriller", "Manga"},
"Empty",
108,
"Viz",
1990,
new Date()
);

Expand Down Expand Up @@ -85,16 +85,4 @@ void saveComicBook() {
comicBookDaoImpl.saveComicBook(comicBookDto2);
}

@Test
void getComicBookBySeriesNameTest() {
ComicBook spiderMan = comicBookDaoImpl.getComicBookBySeriesName("The Amazing Spider-Man");
assertEquals(comicBookDto2.getSeriesTitle(), spiderMan.getSeriesTitle());
assertEquals(comicBookDto2.getAuthor(), spiderMan.getAuthor());
assertEquals(comicBookDto2.getArtist(), spiderMan.getArtist());
assertEquals(ComicBookDto.genreListToString(comicBookDto2.getGenres()), spiderMan.getGenres());
assertEquals(comicBookDto2.getDescription(), spiderMan.getDescription());
assertEquals(comicBookDto2.getNumberOfIssues(), spiderMan.getNumberOfIssues());
assertEquals(comicBookDto2.getPublisher(), spiderMan.getPublisher());
assertEquals(comicBookDto2.getYearPublished(), spiderMan.getYearPublished());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void init() {
void test_getCommentsByComic_1() {
List<CommentDto> actualList = commentDaoImpl.getCommentsByComic(1);
int actual = actualList.size();
assertEquals(3, actual);
assertEquals(4, actual);
}

@Test
Expand Down

0 comments on commit 096569f

Please sign in to comment.