I have been writing the test cases using the mockito. the below is my code in the test cases.

```
@RunWith(SpringRunner.class)
public class LoginControllerTest {

    private MockMvc mockMvc;

    @InjectMocks    
    private LoginService loginService;

    @Mock
    private LoginController loginController;

    @Before
    public void setup() {
        MockitoAnnotations.initMocks(this);
        // Setup Spring test in standalone mode
        mockMvc = MockMvcBuilders.standaloneSetup(loginController).build();

    }

    @Test
    public final void test() throws Exception {

        // Assign
        when(loginService.test()).thenReturn("hello");

        // act
        mockMvc.perform(get("/hello"))
                // Assertion
                .andExpect(status().isOk())
                .andExpect(content().string("Message from service: hello"));
        verify(loginService).test();
    }

    @Test
    public final void usernameInvalidAndPassword() throws Exception {

        User userData = new User();
        userData.setUserName("akhila.s@cloudium.io");
        userData.setPassword("Passw0rd");

        User userDataNew = new User();
        userDataNew.setUserName("akhila.s@cloudium.io");
        userDataNew.setPassword("Passw0rd");

        JSONObject requestBody = new JSONObject();

        requestBody.put("userName", "akhila.s@cloudium.io");
        requestBody.put("password", "Passw0rd");

        JSONObject responseBody = new JSONObject();

        responseBody.put("status_code", "200");
        responseBody.put("message", "ok");

        // Assign
        when(loginService.saveUser(userData)).thenReturn(userDataNew);

        // act
        mockMvc.perform(get("/login")
                .param("userName", "akhila.s@cloudium.io")
                .param("password", "Passw0rd"))
                // Assertion
                .andExpect(status().isOk()).andExpect(content().json(responseBody.toString())).andDo(print());
    }

```

For the first test case its working fine but for the second test it is returning null always. Can anyone please help? Thanks in advance