Exemplo n.º 1
0
 @ApiOperation(
     value = StackOpDescription.GET_STACK_CERT,
     produces = ContentType.JSON,
     notes = Notes.STACK_NOTES)
 @RequestMapping(value = "stacks/{id}/certificate", method = RequestMethod.GET)
 @ResponseBody
 public ResponseEntity<CertificateResponse> getCertificate(@PathVariable Long id) {
   return new ResponseEntity<>(
       new CertificateResponse(tlsSecurityService.getCertificate(id)), HttpStatus.OK);
 }
 @Before
 public void setUp() throws CloudbreakSecuritySetupException {
   stack = TestUtil.stack();
   cluster = TestUtil.cluster(TestUtil.blueprint(), stack, 1L);
   stack.setCluster(cluster);
   clusterRequest = new ClusterRequest();
   clusterResponse = new ClusterResponse();
   when(stackService.get(anyLong())).thenReturn(stack);
   when(stackService.getById(anyLong())).thenReturn(stack);
   when(stackService.findLazy(anyLong())).thenReturn(stack);
   when(clusterRepository.save(any(Cluster.class))).thenReturn(cluster);
   given(tlsSecurityService.buildTLSClientConfig(anyLong(), anyString()))
       .willReturn(new TLSClientConfig("", "/tmp"));
 }