Skip to content

Commit

Permalink
test: 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Ohjintaek committed Dec 22, 2023
1 parent 354f9b6 commit c8fc8f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package co.kirikiri.persistence.dto;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

import co.kirikiri.roadmap.domain.exception.RoadmapException;
import co.kirikiri.roadmap.persistence.dto.RoadmapSearchTagName;
import co.kirikiri.service.exception.BadRequestException;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.ValueSource;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

class RoadmapSearchTagNameTest {

@ParameterizedTest
Expand Down Expand Up @@ -41,6 +41,6 @@ class RoadmapSearchTagNameTest {

// expected
assertThatThrownBy(() -> new RoadmapSearchTagName(name))
.isInstanceOf(BadRequestException.class);
.isInstanceOf(RoadmapException.class);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package co.kirikiri.persistence.dto;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

import co.kirikiri.roadmap.domain.exception.RoadmapException;
import co.kirikiri.roadmap.persistence.dto.RoadmapSearchTitle;
import co.kirikiri.service.exception.BadRequestException;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.ValueSource;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;

class RoadmapSearchTitleTest {

@ParameterizedTest
Expand Down Expand Up @@ -41,6 +41,6 @@ class RoadmapSearchTitleTest {

// expected
assertThatThrownBy(() -> new RoadmapSearchTitle(title))
.isInstanceOf(BadRequestException.class);
.isInstanceOf(RoadmapException.class);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package co.kirikiri.common.resolver;
package co.kirikiri.roadmap.resolver;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.when;

import co.kirikiri.service.dto.member.request.MemberJoinRequest;
import co.kirikiri.roadmap.service.dto.request.RoadmapSaveRequest;
import co.kirikiri.service.dto.member.request.MemberJoinRequest;
import co.kirikiri.service.exception.BadRequestException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import javax.xml.validation.Validator;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
Expand All @@ -23,15 +18,18 @@
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.ModelAndViewContainer;

import javax.xml.validation.Validator;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.when;

@ExtendWith(MockitoExtension.class)
class RoadmapSaveArgumentResolverTest {
class RoadmapSaveArgumentResolverImplTest {

@Mock
private ObjectMapper objectMapper;

@Mock
private Validator validator;

@Mock
private MethodParameter parameter;

Expand All @@ -45,7 +43,7 @@ class RoadmapSaveArgumentResolverTest {
private WebDataBinderFactory binderFactory;

@InjectMocks
private RoadmapSaveArgumentResolver resolver;
private RoadmapSaveArgumentResolverImpl resolver;

@Test
void 정상적으로_핸들러의_파라미터가_객체를_타도록_한다() {
Expand Down

0 comments on commit c8fc8f4

Please sign in to comment.