Guest User

Untitled

a guest
Sep 20th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1.     @Test
  2.     @WithMockUser(username = "test", password = "test", roles = "USER")
  3.     public void givenDepartmentName_whenSuggestDepartment_thenReturnNameJson() throws Exception {
  4.  
  5.         String name = "RSPI";
  6.  
  7.         String location = "Wroclaw";
  8.         String positionName = "(Senior) AR/VR Developer";
  9.  
  10.         PositionNameAndLocationRequest positionNameAndLocationRequest = new PositionNameAndLocationRequest(location, positionName);
  11.  
  12.         given(algorithmService.suggestDepartment(positionNameAndLocationRequest)).willReturn(name);
  13.  
  14.         mvc.perform(post("/api/algorithm/suggest")
  15.                 .content(asJsonString(positionNameAndLocationRequest))
  16.                 .contentType(MediaType.APPLICATION_JSON))
  17.                 .andExpect(status().isOk())
  18.                 .andExpect(jsonPath("$.message", is(name)));
  19.     }
Add Comment
Please, Sign In to add comment