Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test code 완료 및 문서 명세화를 위한 주석 처리 완료 #22

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

alanhakhyeonsong
Copy link
Contributor

JUnit5를 사용하여 단위테스트 작성 완료하였습니다.

Http Status Code 반환 결과로 단위 테스트를 시행하였으며, Controller Layer에서 요청 시 연관되는 Service, Repository Layer 까지 한번에 실행되고, 최종적으로 Http Response 안에 모든 결과 값 또한 log로 출력됩니다.

  • User Domain Test

스크린샷 2021-12-15 오후 11 15 04

  • Charger Domain Test

스크린샷 2021-12-15 오후 11 15 26

@alanhakhyeonsong alanhakhyeonsong merged commit 676508c into main Dec 15, 2021
@alanhakhyeonsong
Copy link
Contributor Author

alanhakhyeonsong commented Dec 17, 2021

  1. 회원가입 성공
  • 입력 값: "email":"test@test.com","userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"
  • 예상 결과: Http Status Code = 201
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select userentity0_.user_id as user_id1_2_, userentity0_.email as email2_2_, userentity0_.phone_num as phone_nu3_2_, userentity0_.user_name as user_nam4_2_, userentity0_.user_pass as user_pas5_2_ from user userentity0_ where userentity0_.email=?
Hibernate: insert into user (user_id, email, phone_num, user_name, user_pass) values (null, ?, ?, ?, ?)

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /users
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"100"]
             Body = {"email":"test@test.com","userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.UserController
           Method = com.swteam6.EVCharger.controller.UserController#createUser(SignUpRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 201
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"email":"test@test.com","userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 회원가입 실패 - Client에서 넘어온 입력 parameter가 null 일 때(하나라도 null인 경우 포함)
  • 입력값: null
  • 예상 결과: Http Status Code = 400, message = javax.validation.constraints.NotNull.message
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select userentity0_.user_id as user_id1_2_, userentity0_.email as email2_2_, userentity0_.phone_num as phone_nu3_2_, userentity0_.user_name as user_nam4_2_, userentity0_.user_pass as user_pas5_2_ from user userentity0_ where userentity0_.email is null

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /users
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"76"]
             Body = {"userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.UserController
           Method = com.swteam6.EVCharger.controller.UserController#createUser(SignUpRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = javax.validation.ConstraintViolationException

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 400
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"timestamp":"2021-12-17T13:04:08.681+00:00","message":"Validation failed for classes [com.swteam6.EVCharger.domain.user.UserEntity] during persist time for groups [javax.validation.groups.Default, ]\nList of constraint violations:[\n\tConstraintViolationImpl{interpolatedMessage='����� ����', propertyPath=email, rootBeanClass=class com.swteam6.EVCharger.domain.user.UserEntity, messageTemplate='{javax.validation.constraints.NotNull.message}'}\n]","details":"uri=/users"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 회원가입 실패 - Client에서 넘어온 입력 값이 email 형식이 아닌 경우
  • 입력값: "email":"test","userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"
  • 예상 결과: Http Status Code = 400, message = javax.validation.constraints.Email.message
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select userentity0_.user_id as user_id1_2_, userentity0_.email as email2_2_, userentity0_.phone_num as phone_nu3_2_, userentity0_.user_name as user_nam4_2_, userentity0_.user_pass as user_pas5_2_ from user userentity0_ where userentity0_.email=?

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /users
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"91"]
             Body = {"email":"test","userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.UserController
           Method = com.swteam6.EVCharger.controller.UserController#createUser(SignUpRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = javax.validation.ConstraintViolationException

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 400
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"timestamp":"2021-12-17T13:04:08.711+00:00","message":"Validation failed for classes [com.swteam6.EVCharger.domain.user.UserEntity] during persist time for groups [javax.validation.groups.Default, ]\nList of constraint violations:[\n\tConstraintViolationImpl{interpolatedMessage='��른 ��� ��� 주��� ���', propertyPath=email, rootBeanClass=class com.swteam6.EVCharger.domain.user.UserEntity, messageTemplate='{javax.validation.constraints.Email.message}'}\n]","details":"uri=/users"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 로그인 성공
  • 입력 값: "email":"test@test.com","userPass":"testPassword"
  • 예상 결과: Http Status Code = 201
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select userentity0_.user_id as user_id1_2_, userentity0_.email as email2_2_, userentity0_.phone_num as phone_nu3_2_, userentity0_.user_name as user_nam4_2_, userentity0_.user_pass as user_pas5_2_ from user userentity0_ where userentity0_.email=?
Hibernate: select userentity0_.user_id as user_id1_2_, userentity0_.email as email2_2_, userentity0_.phone_num as phone_nu3_2_, userentity0_.user_name as user_nam4_2_, userentity0_.user_pass as user_pas5_2_ from user userentity0_ where userentity0_.email=? and userentity0_.user_pass=?

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /users/login
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"51"]
             Body = {"email":"test@test.com","userPass":"testPassword"}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.UserController
           Method = com.swteam6.EVCharger.controller.UserController#loginUser(LoginRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"email":"test@test.com","userPass":"testPassword","userName":"testName","phoneNum":"010-1111-1111"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 로그인 실패 - 등록되지 않은 회원
  • 입력 값: "email":"test@naver.com","userPass":"1234"
  • 예상 결과: Http Status Code = 404, message = 등록되지 않은 회원
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select userentity0_.user_id as user_id1_2_, userentity0_.email as email2_2_, userentity0_.phone_num as phone_nu3_2_, userentity0_.user_name as user_nam4_2_, userentity0_.user_pass as user_pas5_2_ from user userentity0_ where userentity0_.email=?

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /users/login
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"44"]
             Body = {"email":"test@naver.com","userPass":"1234"}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.UserController
           Method = com.swteam6.EVCharger.controller.UserController#loginUser(LoginRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = com.swteam6.EVCharger.exception.UserNotFoundException

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 404
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"timestamp":"2021-12-17T13:04:08.703+00:00","message":"찾� � �� �����.","details":"uri=/users/login"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 로그인 실패 - 파라미터 null
  • 입력 값: null
  • 예상 결과: Http Status Code = 400
  • 실행 결과
------단위 테스트 실행 시작------

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /users/login
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"32"]
             Body = {"email": null, "userPass": null
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.UserController
           Method = com.swteam6.EVCharger.controller.UserController#loginUser(LoginRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = org.springframework.http.converter.HttpMessageNotReadableException

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 400
    Error message = null
          Headers = []
     Content type = null
             Body = 
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. id값으로 충전소 단일 조회 성공
  • 조건: Request URI = /chargers/1
  • 예상 결과: Http Status Code = 200
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select chargerent0_.charger_id as charger_1_0_0_, chargerent0_.address as address2_0_0_, chargerent0_.charger_location as charger_3_0_0_, chargerent0_.charger_name as charger_4_0_0_, chargerent0_.city as city5_0_0_, chargerent0_.closed_dates as closed_d6_0_0_, chargerent0_.fast_charge_type as fast_cha7_0_0_, chargerent0_.fast_num as fast_num8_0_0_, chargerent0_.lat as lat9_0_0_, chargerent0_.lon as lon10_0_0_, chargerent0_.parking_fee as parking11_0_0_, chargerent0_.slow_num as slow_nu12_0_0_ from charger chargerent0_ where chargerent0_.charger_id=?

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /chargers/1
       Parameters = {}
          Headers = []
             Body = null
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.ChargerController
           Method = com.swteam6.EVCharger.controller.ChargerController#findById(Long)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"id":1,"chargerName":"���컨벤���","chargerLocation":"�3��� ���","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":2,"fastNum":0,"parkingFee":"No","lat":35.1467783223,"lon":126.8404826732,"address":"�주��� �구 �무�리� 30"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 충전소 전체 조회 성공
  • 조건: Request URI = /chargers/all
  • 예상 결과: Http Status Code = 200
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select chargerent0_.charger_id as charger_1_0_, chargerent0_.address as address2_0_, chargerent0_.charger_location as charger_3_0_, chargerent0_.charger_name as charger_4_0_, chargerent0_.city as city5_0_, chargerent0_.closed_dates as closed_d6_0_, chargerent0_.fast_charge_type as fast_cha7_0_, chargerent0_.fast_num as fast_num8_0_, chargerent0_.lat as lat9_0_, chargerent0_.lon as lon10_0_, chargerent0_.parking_fee as parking11_0_, chargerent0_.slow_num as slow_nu12_0_ from charger chargerent0_

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /chargers/all
       Parameters = {}
          Headers = []
             Body = null
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.ChargerController
           Method = com.swteam6.EVCharger.controller.ChargerController#findAllCharger()

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = [{"id":1,"chargerName":"���컨벤���","chargerLocation":"�3��� ���","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":2,"fastNum":0,"parkingFee":"No","lat":35.1467783223,"lon":126.8404826732,"address":"�주��� �구 �무�리� 30"},{"id":2,"chargerName":"���컨벤���","chargerLocation":"��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"DC차�모+AC3�+DC콤보","slowNum":1,"fastNum":1,"parkingFee":"Yes","lat":35.1467783223,"lon":126.8404826732,"address":"�주��� �구 �무�리� 30"},{"id":3,"chargerName":"�주��� �구 ���주민��","chargerLocation":"민��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"DC차�모+AC3�+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"No","lat":35.209144,"lon":126.879659,"address":"�주��� �구 ����� 32"},{"id":4,"chargerName":"�주��� �구 문�2���복���","chargerLocation":"��공�주차�","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":1,"fastNum":0,"parkingFee":"Yes","lat":35.18432223,"lon":126.9219174,"address":"�주��� �구 문�� 25"},{"id":5,"chargerName":"�주��� �구청","chargerLocation":"민��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"No","lat":35.174288,"lon":126.9121086,"address":"�주��� �구 ��� 77"},{"id":6,"chargerName":"�주��� �구청","chargerLocation":"��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":1,"fastNum":1,"parkingFee":"No","lat":35.1529017,"lon":126.8906068,"address":"�주��� �구 경�� 33"},{"id":7,"chargerName":"롯���(��컵)","chargerLocation":"주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"Yes","lat":35.1329733,"lon":126.8755729,"address":"�주��� �구 ��� 240"},{"id":8,"chargerName":"DJ ��","chargerLocation":"주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":4,"fastNum":2,"parkingFee":"No","lat":35.146778,"lon":126.8409323,"address":"�주��� �구 �무�리� 30(���)"},{"id":9,"chargerName":"�주���청","chargerLocation":"���주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":14,"fastNum":2,"parkingFee":"No","lat":35.1600999528,"lon":126.851463,"address":"�주��� �구 �방� 111"},{"id":10,"chargerName":"�주��� �구청","chargerLocation":"주차�","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":1,"fastNum":0,"parkingFee":"No","lat":35.1529017,"lon":126.8906068,"address":"�주��� �구 경�� 33"},{"id":11,"chargerName":"�����","chargerLocation":"�����","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":1,"fastNum":0,"parkingFee":"No","lat":35.14813695,"lon":126.9258412,"address":"�주��� �구 ���� 150"},{"id":12,"chargerName":"�� ��베���","chargerLocation":"�� ��베���","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":1,"fastNum":0,"parkingFee":"No","lat":35.13336538,"lon":126.9386613,"address":"�주��� �구 ���� 88"},{"id":13,"chargerName":"�주��� �구청","chargerLocation":"�주�구청","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"Yes","lat":35.14614143,"lon":126.9230951,"address":"�주��� �구 ��� 1"},{"id":14,"chargerName":"(주)���보","chargerLocation":"(주)���보","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":1,"fastNum":0,"parkingFee":"No","lat":35.15001956,"lon":126.9210604,"address":"�주��� �구 ��� 137"},{"id":15,"chargerName":"국민체���","chargerLocation":"국민체���","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"No","lat":35.15231248,"lon":126.9327427,"address":"�주��� �구 �문��205�길 17"},{"id":16,"chargerName":"�구문���","chargerLocation":"�구문���","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"No","lat":35.1285716,"lon":126.9309302,"address":"�주��� �구 �문� 646"},{"id":17,"chargerName":"��� 주민��","chargerLocation":"��� 주민�� 주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"No","lat":35.1115380296,"lon":126.8771095817,"address":"�주��� �구 ��� 66"},{"id":18,"chargerName":"�주��� �구청","chargerLocation":"민��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"No","lat":35.174288,"lon":126.9121086,"address":"�주��� �구 ��� 77"}]
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 도로명 주소 검색 성공
  • 조건: Request URI = /chargers/address, 입력 값: 서구
  • 예상 결과: Http Status Code = 200
  • 실행 결과
------단위 테스트 실행 시작------
Hibernate: select chargerent0_.charger_id as charger_1_0_, chargerent0_.address as address2_0_, chargerent0_.charger_location as charger_3_0_, chargerent0_.charger_name as charger_4_0_, chargerent0_.city as city5_0_, chargerent0_.closed_dates as closed_d6_0_, chargerent0_.fast_charge_type as fast_cha7_0_, chargerent0_.fast_num as fast_num8_0_, chargerent0_.lat as lat9_0_, chargerent0_.lon as lon10_0_, chargerent0_.parking_fee as parking11_0_, chargerent0_.slow_num as slow_nu12_0_ from charger chargerent0_ where chargerent0_.address like ? escape ?

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /chargers/address
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"20"]
             Body = {"address":"서구"}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.ChargerController
           Method = com.swteam6.EVCharger.controller.ChargerController#findAllChargerByAddress(SearchByAddressRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = [{"id":1,"chargerName":"���컨벤���","chargerLocation":"�3��� ���","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":2,"fastNum":0,"parkingFee":"No","lat":35.1467783223,"lon":126.8404826732,"address":"�주��� �구 �무�리� 30"},{"id":2,"chargerName":"���컨벤���","chargerLocation":"��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"DC차�모+AC3�+DC콤보","slowNum":1,"fastNum":1,"parkingFee":"Yes","lat":35.1467783223,"lon":126.8404826732,"address":"�주��� �구 �무�리� 30"},{"id":6,"chargerName":"�주��� �구청","chargerLocation":"��주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":1,"fastNum":1,"parkingFee":"No","lat":35.1529017,"lon":126.8906068,"address":"�주��� �구 경�� 33"},{"id":7,"chargerName":"롯���(��컵)","chargerLocation":"주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":0,"fastNum":1,"parkingFee":"Yes","lat":35.1329733,"lon":126.8755729,"address":"�주��� �구 ��� 240"},{"id":8,"chargerName":"DJ ��","chargerLocation":"주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":4,"fastNum":2,"parkingFee":"No","lat":35.146778,"lon":126.8409323,"address":"�주��� �구 �무�리� 30(���)"},{"id":9,"chargerName":"�주���청","chargerLocation":"���주차�","city":"�주���","closedDates":"��무�","fastChargeType":"AC3�+DC차�모+DC콤보","slowNum":14,"fastNum":2,"parkingFee":"No","lat":35.1600999528,"lon":126.851463,"address":"�주��� �구 �방� 111"},{"id":10,"chargerName":"�주��� �구청","chargerLocation":"주차�","city":"�주���","closedDates":"��무�","fastChargeType":"No","slowNum":1,"fastNum":0,"parkingFee":"No","lat":35.1529017,"lon":126.8906068,"address":"�주��� �구 경�� 33"}]
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———
  1. 도로명 주소 검색 실패 - Client에서 넘어온 address 값이 null 인 경우
  • 조건: Request URI = /chargers/address, 입력 값: null
  • 예상 결과: Http Status Code = 400, message = "message":"Value must not be null!; nested exception is java.lang.IllegalArgumentException: Value must not be null!"
  • 실행 결과
------단위 테스트 실행 시작------

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /chargers/address
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Content-Length:"2"]
             Body = {}
    Session Attrs = {}

Handler:
             Type = com.swteam6.EVCharger.controller.ChargerController
           Method = com.swteam6.EVCharger.controller.ChargerController#findAllChargerByAddress(SearchByAddressRequest)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = org.springframework.dao.InvalidDataAccessApiUsageException

ModelAndView:
        View name = null
             View = null
            Model = null

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 400
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body = {"timestamp":"2021-12-17T13:14:15.319+00:00","message":"Value must not be null!; nested exception is java.lang.IllegalArgumentException: Value must not be null!","details":"uri=/chargers/address"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
———단위 테스트 실행 완료———

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant