@Test public void test_renew_successfully() { String token = "5PDrOhsy4ig8L3EpsJZSLAMg"; String responseJson = "{\"client_token\": \"18oVRlB3ft88S6U9raoEDnKn\",\"policies\": [\"safeadmin\"],\"lease_duration\": 1800000}"; Response response = getMockResponse(HttpStatus.OK, true, responseJson); ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseJson); when(reqProcessor.process("/auth/tvault/renew","{}", token)).thenReturn(response); ResponseEntity<String> responseEntity = vaultAuthService.renew(token); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); assertEquals(responseEntityExpected, responseEntity); }
public ResponseEntity<String> renew(String token) { Response response = reqProcessor.process("/auth/tvault/renew","{}", token); if(HttpStatus.OK.equals(response.getHttpstatus())){ return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }else{ return ResponseEntity.status(response.getHttpstatus()).body("{\"errors\":[\"Self renewal of token Failed.\"]}"); } }
VaultAuthService { public ResponseEntity<String> renew(String token) { Response response = reqProcessor.process("/auth/tvault/renew","{}", token); if(HttpStatus.OK.equals(response.getHttpstatus())){ return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }else{ return ResponseEntity.status(response.getHttpstatus()).body("{\"errors\":[\"Self renewal of token Failed.\"]}"); } } }
VaultAuthService { public ResponseEntity<String> renew(String token) { Response response = reqProcessor.process("/auth/tvault/renew","{}", token); if(HttpStatus.OK.equals(response.getHttpstatus())){ return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }else{ return ResponseEntity.status(response.getHttpstatus()).body("{\"errors\":[\"Self renewal of token Failed.\"]}"); } }  }
VaultAuthService { public ResponseEntity<String> renew(String token) { Response response = reqProcessor.process("/auth/tvault/renew","{}", token); if(HttpStatus.OK.equals(response.getHttpstatus())){ return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }else{ return ResponseEntity.status(response.getHttpstatus()).body("{\"errors\":[\"Self renewal of token Failed.\"]}"); } }  Map<String,Object> filterDuplicateSafePermissions(Map<String,Object> access); Map<String,Object> filterDuplicateSvcaccPermissions(Map<String,Object> access); ResponseEntity<String> login(UserLogin user); ResponseEntity<String> renew(String token); ResponseEntity<String> lookup( String token); ResponseEntity<String> revoke(String token); }
VaultAuthService { public ResponseEntity<String> renew(String token) { Response response = reqProcessor.process("/auth/tvault/renew","{}", token); if(HttpStatus.OK.equals(response.getHttpstatus())){ return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }else{ return ResponseEntity.status(response.getHttpstatus()).body("{\"errors\":[\"Self renewal of token Failed.\"]}"); } }  Map<String,Object> filterDuplicateSafePermissions(Map<String,Object> access); Map<String,Object> filterDuplicateSvcaccPermissions(Map<String,Object> access); ResponseEntity<String> login(UserLogin user); ResponseEntity<String> renew(String token); ResponseEntity<String> lookup( String token); ResponseEntity<String> revoke(String token);  }