PostNewBookingItem

2

tests

0

failures

0

ignored

0.084s

duration

100%

successful

Tests

Test Duration Result
globalAdmin_canAddValidBookingItem() 0.069s passed
globalAdmin_canNotAddInvalidBookingItem() 0.015s passed

Standard output

2026-08-10T16:28:04.823Z  INFO 235 --- [    Test worker] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [net.hostsharing.hsadminng.hs.booking.item.HsBookingItemControllerRestTest$PostNewBookingItem]: PostNewBookingItem does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
2026-08-10T16:28:04.826Z  INFO 235 --- [    Test worker] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration net.hostsharing.hsadminng.HsadminNgApplication for test class net.hostsharing.hsadminng.hs.booking.item.HsBookingItemControllerRestTest$PostNewBookingItem

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /api/hs/booking/items
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Authorization:"Bearer eyJraWQiOiJ0ZXN0LWtleSIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJodHRwOi8vdGVzdC1pc3N1ZXIiLCJzdWIiOiJoc2gtYWxleF9zdXBlcnVzZXIiLCJhdWQiOiJhcGkiLCJncm91cHMiOltdLCJleHAiOjE3ODYzODI4ODQsImp0aSI6IjJmYjQ2OWVmLTk0NzEtNDgxNi1iNTI5LWQ1NTUyYjk2OWMzNyJ9.TPYp2OSqjCSq1BHRqI5SUoV0vqO9rVkAr50TCDpETxqGoAOp_xRj0sXsSeoU5N89K_A2xGnlXJQJKhOETUuK7c99eS3qEa1u4jifPFbXKamzAhKRrCWALkZAAYq67D6vFSUZCOh5gxrncC_kcyZS_Ef7dLZnaWTmiUQ5f57iElCFd-0f7ZxpyyOi_2bisyGvU_vBkFv3sLxYpPX5J6WhCCxyJ5_AOUSuJOpXlrvt3M-4Dcnb24EowNHWCdwGotra5rJWvaqvydUerJC6oGQw8m1_nGrnNllQsWfXvRKmTGtVemeCCpxeYsDvuPNScpgZ00rKqb9Phj5X8bBgtctFfw", Accept:"application/json", Content-Length:"227"]
             Body = {
    "project.uuid": "176d4c1c-5dfc-4065-aec4-e4ea139804e0",
    "type": "MANAGED_SERVER",
    "caption": "some new booking",
    "validTo": "2026-09-10",
    "resources": { "CPU": 12, "RAM": 4, "SSD": 100, "Traffic": 250 }
}

    Session Attrs = {}

Handler:
             Type = net.hostsharing.hsadminng.hs.booking.item.HsBookingItemController
           Method = net.hostsharing.hsadminng.hs.booking.item.HsBookingItemController#postNewBookingItem(String, HsBookingItemInsertResource)

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 = [Vary:"Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers", Location:"http://localhost/api/hs/booking/items/88cda23d-e2f4-4e14-932a-14ac474ac6db", Content-Type:"application/json", X-Content-Type-Options:"nosniff", X-XSS-Protection:"0", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"]
     Content type = application/json
             Body = {"uuid":"88cda23d-e2f4-4e14-932a-14ac474ac6db","type":"MANAGED_SERVER","caption":"some new booking","validFrom":"2026-08-10","validTo":"2026-09-10","resources":{"CPU":12,"SSD":100,"RAM":4,"Traffic":250}}
    Forwarded URL = null
   Redirected URL = http://localhost/api/hs/booking/items/88cda23d-e2f4-4e14-932a-14ac474ac6db
          Cookies = []

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /api/hs/booking/items
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Authorization:"Bearer eyJraWQiOiJ0ZXN0LWtleSIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJodHRwOi8vdGVzdC1pc3N1ZXIiLCJzdWIiOiJoc2gtYWxleF9zdXBlcnVzZXIiLCJhdWQiOiJhcGkiLCJncm91cHMiOltdLCJleHAiOjE3ODYzODI4ODQsImp0aSI6IjE5NjQxMDEwLTJlMDctNDY2Mi1iMDcxLTNjMGQ4ZTg0ZjZhMCJ9.eaBe9-hs5uxDyoz7hnGsGPvN7FJwFZb-ITL5QfeEYakMb9IYLpDhVfBvjd8gBBoebrMXawzWd8DK__494_e66LSUUpHBsRXcm4rN14L2wjcC0C5GrRuEeVKWYuFcQVAW0JnP2eJATy3p68RJHwW0mXIYD5-lpicbNo5IUSpMIA6FMAAf1NAs6ENhNsD7kHrIkU8EyTsOehXiYM6x2WwVXBMbzhqHD3DIfPW31l1GtRkS3WWvhclbhh8sZSGo3w_A4vmIh_O-uBp2XHSOa2i70hXmpUNcWrqMAmvWNYTrVBbxzY3pVIsSQDnwCTI60N2NfeOtj0fzOw2ZMAg4bGJt9Q", Accept:"application/json", Content-Length:"262"]
             Body = {
    "project.uuid": "60aacf6c-168d-49ce-abc4-0afde2fec809",
    "type": "MANAGED_SERVER",
    "caption": "some new booking",
    "validFrom": "2026-09-10", // not specified => not accepted
    "resources": { "CPU": 12, "RAM": 4, "SSD": 100, "Traffic": 250 }
}

    Session Attrs = {}

Handler:
             Type = net.hostsharing.hsadminng.hs.booking.item.HsBookingItemController
           Method = net.hostsharing.hsadminng.hs.booking.item.HsBookingItemController#postNewBookingItem(String, HsBookingItemInsertResource)

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 = [Vary:"Origin", "Access-Control-Request-Method", "Access-Control-Request-Headers", Content-Type:"application/json", X-Content-Type-Options:"nosniff", X-XSS-Protection:"0", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"]
     Content type = application/json
             Body = {"timestamp":"2026-08-10 04:28:04","path":"","statusCode":400,"statusPhrase":"Bad Request","message":"ERROR: [400] property \"validFrom\": JSON parse error: Unrecognized field \"validFrom\" (class net.hostsharing.hsadminng.hs.booking.generated.api.v1.model.HsBookingItemInsertResource), not marked as ignorable"}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []