@Test public void test_renew() throws Exception { String responseMessage = "{\"client_token\": \"18oVRlB3ft88S6U9raoEDnKn\",\"policies\": [\"safeadmin\"],\"lease_duration\": 1800000}"; ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseMessage); when(vaultAuthService.renew(eq("5PDrOhsy4ig8L3EpsJZSLAMg"))).thenReturn(responseEntityExpected); mockMvc.perform(MockMvcRequestBuilders.get("/v2/auth/tvault/renew") .header("vault-token", "5PDrOhsy4ig8L3EpsJZSLAMg") .header("Content-Type", "application/json;charset=UTF-8")) .andExpect(status().isOk()) .andExpect(content().string(containsString(responseMessage))); }
@GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") public ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token){ return vaultAuthService.renew(token); }
VaultAuthControllerV2 { @GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") public ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token){ return vaultAuthService.renew(token); } }
VaultAuthControllerV2 { @GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") public ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token){ return vaultAuthService.renew(token); }  }
VaultAuthControllerV2 { @GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") public ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token){ return vaultAuthService.renew(token); }  @PostMapping(value="/v2/auth/tvault/login",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.login.value}", notes = "${VaultAuthControllerV2.login.notes}") ResponseEntity<String> login(@RequestBody UserLogin user); @GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token); @PostMapping(value="/v2/auth/tvault/lookup",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.lookup.value}", notes = "${VaultAuthControllerV2.lookup.notes}") ResponseEntity<String> lookup(@RequestHeader(value="vault-token") String token); @GetMapping(value="/auth/tvault/revoke",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.revoke.value}", notes = "${VaultAuthControllerV2.revoke.notes}") @ApiResponses(value={ @ApiResponse(code = 204, message = "Revoked Successfully") }) ResponseEntity<String> revoke(@RequestHeader(value="vault-token") String token); }
VaultAuthControllerV2 { @GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") public ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token){ return vaultAuthService.renew(token); }  @PostMapping(value="/v2/auth/tvault/login",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.login.value}", notes = "${VaultAuthControllerV2.login.notes}") ResponseEntity<String> login(@RequestBody UserLogin user); @GetMapping(value="/v2/auth/tvault/renew",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.renew.value}", notes = "${VaultAuthControllerV2.renew.notes}") ResponseEntity<String> renew(@RequestHeader(value="vault-token") String token); @PostMapping(value="/v2/auth/tvault/lookup",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.lookup.value}", notes = "${VaultAuthControllerV2.lookup.notes}") ResponseEntity<String> lookup(@RequestHeader(value="vault-token") String token); @GetMapping(value="/auth/tvault/revoke",produces="application/json") @ApiOperation(value = "${VaultAuthControllerV2.revoke.value}", notes = "${VaultAuthControllerV2.revoke.notes}") @ApiResponses(value={ @ApiResponse(code = 204, message = "Revoked Successfully") }) ResponseEntity<String> revoke(@RequestHeader(value="vault-token") String token);  }