There is a type of statement in java that I could not understand or even find anything about through googling. I would like to share an example which I wrote but without understanding the language structure :
MvcResult result = this.mockMvc.perform(MockMvcRequestBuilders.post("/user_sessions/first")
.contentType(MediaType.APPLICATION_JSON)
.content("{\"username\":\""+username+"\",\"password\":\""+password+"\"}"))
.andExpect(MockMvcResultMatchers.status().isOk())
.andReturn();
I don't understand what contentType , content, andExpect and andReturn are. They are obviously functions, but how can I call them like this. What class do they belong to? Overally I am very confused with the structure here.