PostNewBookingItem

2

tests

0

failures

0

ignored

0.060s

duration

100%

successful

Tests

Test Duration Result
globalAdmin_canAddValidBookingItem() 0.044s passed
globalAdmin_canNotAddInvalidBookingItem() 0.016s passed

Standard output

2026-08-10T13:31:36.962Z  INFO 234 --- [    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-10T13:31:36.965Z  INFO 234 --- [    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.eyJpc3MiOiJodHRwOi8vdGVzdC1pc3N1ZXIiLCJzdWIiOiJoc2gtYWxleF9zdXBlcnVzZXIiLCJhdWQiOiJhcGkiLCJncm91cHMiOltdLCJleHAiOjE3ODYzNzIyOTYsImp0aSI6ImFjNjY3NjY0LWEzMTYtNDhiNi1iYTQ0LTBmYjQ3YWVjMDY1MiJ9.Nk4A-5BY3oZClo41AEJGHYtRh8y_WKA8vFT4JuuCFPY-s2UpUchzETbYjUy2h2BXNF--IS2l2o6WLcAwfbbZE17wsE6zmrJi4YYIIw3nODFJBZ2yTgOzBiu0gl7RZa77YdYEhjNb50-FGCiNim3GDB2LVZ6UmGUWnCKX1hDf2YYkuAw9qZsn3Kzcmai2soZ6mWgo9SROeyBsDdNKKqc7vqW_9S45LNN-Bw_KYofAhlxgvrLUOuklPTBRJwcCJ9stXJ9bbGM999XFLbUjrstfmO7pCxxtT-nvGPXK3m-5pNyV1aHjDZk3lp74Vgs5Iv39_NwcpfnEuLGaI20htIfqYQ", Accept:"application/json", Content-Length:"227"]
             Body = {
    "project.uuid": "212d7951-46f6-4861-97d1-213d8b661a1a",
    "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/71d5ff47-36c0-4d41-aa46-e963d20bc174", 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":"71d5ff47-36c0-4d41-aa46-e963d20bc174","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/71d5ff47-36c0-4d41-aa46-e963d20bc174
          Cookies = []

MockHttpServletRequest:
      HTTP Method = POST
      Request URI = /api/hs/booking/items
       Parameters = {}
          Headers = [Content-Type:"application/json;charset=UTF-8", Authorization:"Bearer eyJraWQiOiJ0ZXN0LWtleSIsImFsZyI6IlJTMjU2In0.eyJpc3MiOiJodHRwOi8vdGVzdC1pc3N1ZXIiLCJzdWIiOiJoc2gtYWxleF9zdXBlcnVzZXIiLCJhdWQiOiJhcGkiLCJncm91cHMiOltdLCJleHAiOjE3ODYzNzIyOTcsImp0aSI6IjZiNjc4ZWM5LWMyNDItNDFhMS05N2Y3LTE5Mzg4OGYwZDkxOCJ9.i-Z7JObM2pwGxP0t3xUJ2aB0GjYYLWP0uXU7gI3beDUJ4OzlGDQg4o_Cur7xJUJhYZdsvW1ooIRTnui0Od4teV5UZ6AE0waXVRez8IUUuucOLV-U5q4CSnhgOK73PILfOag5g_OFd1vb5sXJkTLfmLB2V3qB51LqKzIHSA9Dmy6J-RNV0-h0IfNH62M_V9TYibvnCbI6_mOynC0xJ1b6Bsp92IvxLwmG9tzWARMp776jSLAnDEgWWsrQgsuOxNTJUmJC7PAyQkNHLH7O4jyVczg3hR0Gv_1M5ZfRQ3_WtjLMjf1qgmEUy3tZctVsjDZy7bSxp_afBsYFDZ7MBn7hxw", Accept:"application/json", Content-Length:"262"]
             Body = {
    "project.uuid": "3d4b78fa-650b-4f52-8efc-d91bce571d98",
    "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 01:31:37","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 = []