강의

멘토링

커뮤니티

Inflearn Community Q&A

limesolution's profile image
limesolution

asked

Spring-based REST API development

Event Repository

406에러가 나요..

Written on

·

372

0

java.lang.AssertionError: Status 

Expected :201

Actual   :406

<Click to see difference>

at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:59)

at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:122)

at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:627)

at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:196)

at com.restapi.studyrestapi.EventControllerTests.createEvent(EventControllerTests.java:55)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

springjavarest-api

Answer 1

0

whiteship님의 프로필 이미지
whiteship
Instructor

createEvent 처리시 201 응답이 나오지 않고 406 응답이라 테스트가 실패했는데 4**로 시작하는걸 보면 요청에서 보내온 데이터가 뭔가 잘못된거 같아 보이네요.

작성하신 코드를 깃헙에 올려서 공유해 주시면 봐드릴께요.

limesolution's profile image
limesolution

asked

Ask a question