Untitled

mail@pastecode.io avatar
unknown
java
2 years ago
2.7 kB
3
Indexable
Never
    
    public String CLIENT = "/client";
    
    public String CREATE_USER_ADDRESS_CLIENT = "/createUserAddress?username=user2";
    
    @Test
    void createUserAddressClient() throws Exception {
        mockMvc.perform(get(CLIENT + CREATE_USER_ADDRESS_CLIENT)
                        .contentType("application/json").header("Authorization", "Bearer " + TOKEN)).andDo(print())
                .andExpect(status().isOk())
                .andDo(document("{methodName}",
                        preprocessRequest(prettyPrint()),
                        preprocessResponse(prettyPrint())));
    }
    
    ===============================================================================================================================
    
    MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /client/createUserAddress
       Parameters = {username=[user2]}
          Headers = [Content-Type:"application/json", Authorization:"Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkVFaWVwSFhpLTVrRVp4Q1AxbHU0aSJ9.eyJpc3MiOiJodHRwczovL2Rldi1zaHpydW1zOS5qcC5hdXRoMC5jb20vIiwic3ViIjoiYXV0aDB8NjJiMTY0MTY3ZTNiODQ3M2YxMzU1OTM3IiwiYXVkIjoiaHR0cHM6Ly80NC4yMDUuMjM4LjIxMjo4MDgwLyIsImlhdCI6MTY1NzA5NjE2MSwiZXhwIjoxNjU3MTgyNTYxLCJhenAiOiJoSEFUS3MwUk5FaXBDcDB3Wkt0TXh0SVV6aEtJTHd4UyIsInNjb3BlIjoiY2xpZW50X2FwcCIsImd0eSI6InBhc3N3b3JkIiwicGVybWlzc2lvbnMiOlsiY2xpZW50X2FwcCJdfQ.qIRnsy4lT0TTdbb5U45-ytq6kaqcFeU9mCL2_FnHfTFF72M9wBTDD2cYTF11NaNRs7bHnjBUiVtUKRXQM4uwpROThDJmz-lxpgxCDqOz55Jim-PTVJ4tjIpMPs1-c-mreBylUmwxleCWttZiTyqUWcchVStWVIvXuVQwHcMWYDTKp3nGMWxKp--sNbHy_rMxlRg_bjTQW8EJkJrGCM9yRXQPcHscdhW3zo8Kn1veLTrAuFeYQA0ywrd_OZ_3dBXWBwgEZJfNoWpqg5Dqe4GDoBuxh4B67lQtxozVkqFxWVClIuboNCUHfG75COEsld6eJ4WYCIvBugtOskhc0iFGZQ"]
             Body = <no character encoding set>
    Session Attrs = {}

Handler:
             Type = com.posbang.algoaddrmgr.controller.algo.AlgoAddressController
           Method = com.posbang.algoaddrmgr.controller.algo.AlgoAddressController#createUserAddress_Client(String, String, String)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

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"]
     Content type = application/json
             Body = {"err_msg":"App code does not exist."}
    Forwarded URL = null
   Redirected URL = null
          Cookies = []

java.lang.AssertionError: Status expected:<200> but was:<400>
Expected :200
Actual   :400