Skip to content
Snippets Groups Projects
Commit 3f4e0422 authored by Ester Vilímková's avatar Ester Vilímková
Browse files

Adding Ids to CourseMapperTest

parent ad607fa6
No related branches found
No related tags found
2 merge requests!31M2,!23M2 course tests
Pipeline #
This commit is part of merge request !23. Comments created here will be created in the context of that merge request.
......@@ -5,6 +5,7 @@ import org.fuseri.model.dto.course.CourseDto;
import org.fuseri.model.dto.course.LanguageTypeDto;
import org.fuseri.model.dto.course.ProficiencyLevelDto;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
......@@ -27,6 +28,13 @@ final class CourseMapperTest {
@Autowired
private CourseMapper CourseMapper;
@BeforeEach
void setUp()
{
course.setId(1L);
courseDto.setId(1L);
}
@Test
void mapNullToDto() {
var createdDto = CourseMapper.mapToDto(null);
......@@ -132,7 +140,6 @@ final class CourseMapperTest {
void mapToCourseCourseCreateDto() {
var createdCourse = CourseMapper.mapToCourse(courseCreateDto);
Assertions.assertEquals(course.getId(), createdCourse.getId());
Assertions.assertEquals(course.getName(), createdCourse.getName());
Assertions.assertEquals(course.getCapacity(), createdCourse.getCapacity());
Assertions.assertEquals(course.getStudents(), createdCourse.getStudents());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment