SysControllerV2 { @ApiOperation(value = "${SysControllerV2.checkSealStatus.value}", notes = "${SysControllerV2.checkSealStatus.notes}") @GetMapping(value ="/v2/seal-status" ,produces="application/json") public ResponseEntity<String> checkVaultSealStatus(){ return sysService.checkVaultSealStatus(); }  @ApiOperation(value = "${SysControllerV2.checkVaultHealth.value}", notes = "${SysControllerV2.checkVaultHealth.notes}") @GetMapping(value ="/v2/health" ,produces="application/json") ResponseEntity<String> checkVaultHealth(); @ApiOperation(value = "${SysControllerV2.checkSealStatus.value}", notes = "${SysControllerV2.checkSealStatus.notes}") @GetMapping(value ="/v2/seal-status" ,produces="application/json") ResponseEntity<String> checkVaultSealStatus(); @ApiOperation(value = "${SysControllerV2.unseal.value}", notes = "${SysControllerV2.unseal.notes}") @PostMapping(value ="/v2/unseal" , consumes = "application/json" ,produces="application/json") ResponseEntity<String> unseal(@RequestBody Unseal unseal); @ApiOperation(value = "${SysControllerV2.unsealProgress.value}", notes = "${SysControllerV2.unsealProgress.notes}") @GetMapping(value ="/v2/unseal-progress" ,produces="application/json") ResponseEntity<String> unsealProgress(@RequestParam("serverip" ) String serverip);  }
@Test public void test_checkVaultSealStatus() throws Exception { String responseMessage = "{\"messages\": {\"type\": \"shamir\",\"initialized\": true,\"sealed\": false," + "\"progress\": 0,\"version\": \"0.11.3\",\"migration\": null,\"cluster_name\":" + " \"vault-cluster-9f404bc2\", \"cluster_id\": \"a26bf9f9-84e2-de1a-a4d3-cffec0ddf10b\"," + " \"recovery_seal\": false}}"; ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK).body(responseMessage); when(sysService.checkVaultSealStatus()).thenReturn(responseEntityExpected); mockMvc.perform(MockMvcRequestBuilders.get("/v2/seal-status") .header("Content-Type", "application/json;charset=UTF-8")) .andExpect(status().isOk()) .andExpect(content().string(containsString(responseMessage))); }