@Test
public void test_getSelfServiceTokenWithAppRole_sscred_success() throws Exception {

ring jsonStr = "{\"role_id\":\"testroleid\",\"secret_id\":\"testsecretid\"}";
    ReflectionTestUtils.setField(tokenUtils, "selfserviceUsername", "dGVzdGFkbWlu");
    ReflectionTestUtils.setField(tokenUtils, "selfservicePassword", "dGVzdGFkbWlu");
    ReflectionTestUtils.setField(tokenUtils, "vaultAuthMethod", "userpass");
    
    SSCred sscred = new SSCred();
    sscred.setUsername("dGVzdGFkbWlu");
    sscred.setPassword("dGVzdGFkbWlu");
    
    ReflectionTestUtils.setField(ControllerUtil.class,"sscred", sscred);
    ReflectionTestUtils.setField(ControllerUtil.class,"ssUsername", sscred.getUsername());
    ReflectionTestUtils.setField(ControllerUtil.class,"ssPassword", sscred.getPassword());
    
    when(JSONUtil.getJSON(Mockito.any())).thenReturn(jsonStr);
    Response response = getMockResponse(HttpStatus.OK, true, "{\n" + 
    		"  \"auth\": {\n" + 
    		"    \"client_token\": \"s.6tdd9QSp50YwJwjXViRXGnMQT4\",\n" + 
    		"    \"accessor\": \"7M3bp7PTaOHeB4u2J9zVfE9g\",\n" + 
    		"    \"policies\": [\n" + 
    		"      \"default\",\n" + 
    		"      \"string\"\n" + 
    		"    ],\n" + 
    		"    \"token_policies\": [\n" + 
    		"      \"default\",\n" + 
    		"      \"string\"\n" + 
    		"    ],\n" + 
    		"    \"metadata\": {\n" + 
    		"      \"role_name\": \"approle\"\n" + 
    		"    },\n" + 
    		"    \"lease_duration\": 2764800,\n" + 
    		"    \"renewable\": true,\n" + 
    		"    \"entity_id\": \"5e191de5-7b96-b9cc-71d5-d254b636308b\",\n" + 
    		"    \"token_type\": \"service\"\n" + 
    		"  },\n" + 
    		"  \"data\": null,\n" + 
    		"  \"lease_duration\": 0,\n" + 
    		"  \"lease_id\": \"\"\n" + 
    		"}");
    when(reqProcessor.process("/auth/approle/login",jsonStr,"")).thenReturn(response);
    String token = tokenUtils.getSelfServiceTokenWithAppRole();
    assertEquals("s.6tdd9QSp50YwJwjXViRXGnMQT4", token);
}