getappmap / getappmap/appmap-java

Test failures in a Kotlin spring project

Đang mở
#67 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Java
Star
88
Fork
17
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
1

Mô tả

Project: https://github.com/spring-guides/tut-spring-boot-kotlin.git

appmap.yml:

# appmap.yml
name: MyFirstKotlin/AppMap

packages:
  # List the packages you'd like to record here.
  - path: com.example.blog

agent.log

Shell output:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.2.RELEASE)

2021-03-23 16:55:21.332  WARN 76617 --- [           main] o.s.boot.StartupInfoLogger               : InetAddress.getLocalHost().getHostName() took 5006 milliseconds to respond. Please verify your network configuration (macOS machines may need to add entries to /etc/hosts).
2021-03-23 16:55:26.340  INFO 76617 --- [           main] com.example.blog.HttpControllersTests    : Starting HttpControllersTests on Ubehebe.local with PID 76617 (started by ptrdvrk in /Users/ptrdvrk/work/github/java/tut-spring-boot-kotlin)
2021-03-23 16:55:26.341  INFO 76617 --- [           main] com.example.blog.HttpControllersTests    : No active profile set, falling back to default profiles: default
2021-03-23 16:55:32.245  INFO 76617 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2021-03-23 16:55:32.373  INFO 76617 --- [           main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet ''
2021-03-23 16:55:32.373  INFO 76617 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Initializing Servlet ''
2021-03-23 16:55:32.377  INFO 76617 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Completed initialization in 4 ms
2021-03-23 16:55:32.393  INFO 76617 --- [           main] com.example.blog.HttpControllersTests    : Started HttpControllersTests in 21.094 seconds (JVM running for 72.569)
2021-03-23 16:55:32.829  WARN 76617 --- [           main] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: no answer found for: Iterable(child of com.example.blog.ArticleRepository#0 bean#2#3).iterator(); nested exception is com.fasterxml.jackson.databind.JsonMappingException: no answer found for: Iterable(child of com.example.blog.ArticleRepository#0 bean#2#3).iterator()]

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /api/article/
       Parameters = {}
          Headers = [Accept:"application/json"]
             Body = <no character encoding set>
    Session Attrs = {}

Handler:
             Type = com.example.blog.ArticleController
           Method = com.example.blog.ArticleController#findAll()

Async:
    Async started = false
     Async result = null

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

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

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 500
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body =
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
2021-03-23 16:55:32.882  WARN 76617 --- [           main] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: no answer found for: Iterable(child of com.example.blog.UserRepository#0 bean#1#4).iterator(); nested exception is com.fasterxml.jackson.databind.JsonMappingException: no answer found for: Iterable(child of com.example.blog.UserRepository#0 bean#1#4).iterator()]

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /api/user/
       Parameters = {}
          Headers = [Accept:"application/json"]
             Body = <no character encoding set>
    Session Attrs = {}

Handler:
             Type = com.example.blog.UserController
           Method = com.example.blog.UserController#findAll()

Async:
    Async started = false
     Async result = null

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

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

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 500
    Error message = null
          Headers = [Content-Type:"application/json"]
     Content type = application/json
             Body =
    Forwarded URL = null
   Redirected URL = null
          Cookies = []
[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 21.598 s <<< FAILURE! - in com.example.blog.HttpControllersTests
[ERROR] List articles  Time elapsed: 0.446 s  <<< FAILURE!
java.lang.AssertionError: Status expected:<200> but was:<500>
	at com.example.blog.HttpControllersTests.List articles(HttpControllersTests.kt:30)

[ERROR] List users  Time elapsed: 0.029 s  <<< FAILURE!
java.lang.AssertionError: Status expected:<200> but was:<500>
	at com.example.blog.HttpControllersTests.List users(HttpControllersTests.kt:44)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với dự án tut-spring-boot-kotlin được liên kết và chạy HttpControllersTests.kt, đặc biệt là các assertion ở dòng 30 và 44. Xem xét agent.log cùng với các lỗi của GET /api/article/ và GET /api/user/; công việc được xem là hoàn tất khi cả hai bài kiểm thử đều đạt với trạng thái 200 như mong đợi và không có lỗi serialization nào được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, kotlin, spring-boot
Lĩnh vực
api, backend, testing
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.