File src/main/java/com/kingfisher/deployment/audit/controller/DeploymentAuditController.java changed (mode: 100644) (index a3df54a..05dca1c) |
... |
... |
package com.kingfisher.deployment.audit.controller; |
2 |
2 |
|
|
3 |
3 |
import java.util.List;
|
import java.util.List;
|
4 |
4 |
|
|
|
5 |
|
import org.slf4j.Logger;
|
|
6 |
|
import org.slf4j.LoggerFactory;
|
5 |
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
6 |
8 |
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
7 |
9 |
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
8 |
10 |
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
9 |
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
10 |
11 |
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
11 |
12 |
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
12 |
13 |
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
... |
... |
import io.swagger.annotations.ApiParam; |
24 |
25 |
import io.swagger.annotations.ApiResponse;
|
import io.swagger.annotations.ApiResponse;
|
25 |
26 |
import io.swagger.annotations.ApiResponses;
|
import io.swagger.annotations.ApiResponses;
|
26 |
27 |
|
|
27 |
|
import org.slf4j.Logger;
|
|
28 |
|
import org.slf4j.LoggerFactory;
|
|
29 |
|
|
|
30 |
28 |
@RestController
|
@RestController
|
31 |
29 |
@Api(value = "DeploymentAudit")
|
@Api(value = "DeploymentAudit")
|
32 |
30 |
@RequestMapping("/v1/deployments")
|
@RequestMapping("/v1/deployments")
|
|
... |
... |
public class DeploymentAuditController { |
45 |
43 |
* @throws DeploymentAuditException
|
* @throws DeploymentAuditException
|
46 |
44 |
*/
|
*/
|
47 |
45 |
@ApiOperation("Add a set of deployments audits")
|
@ApiOperation("Add a set of deployments audits")
|
48 |
|
@ApiResponses(value = { @ApiResponse(code = 201, message = "Success"), @ApiResponse(code = 400, message = "Bad Request") })
|
|
|
46 |
|
@ApiResponses(value = { @ApiResponse(code = 201, message = "Success"),
|
|
47 |
|
@ApiResponse(code = 400, message = "Bad Request") })
|
49 |
48 |
@PostMapping(value = "", consumes = "application/json", produces = "application/json")
|
@PostMapping(value = "", consumes = "application/json", produces = "application/json")
|
50 |
|
public ResponseEntity<String> audit(@ApiParam(value = "Deployments that need adding to the audit", required = true) @RequestBody List<JenkinsDeploymentStatus> jenkinsDeploymentStatuses) throws DeploymentAuditException {
|
|
|
49 |
|
public ResponseEntity<String> audit(
|
|
50 |
|
@ApiParam(value = "Deployments that need adding to the audit", required = true) @RequestBody List<JenkinsDeploymentStatus> jenkinsDeploymentStatuses)
|
|
51 |
|
throws DeploymentAuditException {
|
51 |
52 |
LOGGER.debug("Enter class: {} method: {}", this.getClass().getSimpleName(), "audit");
|
LOGGER.debug("Enter class: {} method: {}", this.getClass().getSimpleName(), "audit");
|
52 |
53 |
deploymentAuditService.recordDeployments(jenkinsDeploymentStatuses);
|
deploymentAuditService.recordDeployments(jenkinsDeploymentStatuses);
|
53 |
54 |
LOGGER.debug("Exit class: {} method: {}", this.getClass().getSimpleName(), "audit");
|
LOGGER.debug("Exit class: {} method: {}", this.getClass().getSimpleName(), "audit");
|
|
... |
... |
public class DeploymentAuditController { |
67 |
68 |
* @throws DeploymentAuditException
|
* @throws DeploymentAuditException
|
68 |
69 |
*/
|
*/
|
69 |
70 |
@ApiOperation("Generates an Excel Report with application status across environments")
|
@ApiOperation("Generates an Excel Report with application status across environments")
|
70 |
|
@ApiResponses(value = { @ApiResponse(code = 201, message = "Success", response = Byte[].class), @ApiResponse(code = 400, message = "Invalid request parameterts", response = AuditError.class) })
|
|
|
71 |
|
@ApiResponses(value = { @ApiResponse(code = 201, message = "Success", response = Byte[].class),
|
|
72 |
|
@ApiResponse(code = 400, message = "Invalid request parameterts", response = AuditError.class) })
|
71 |
73 |
@PostMapping(value = "/report", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
@PostMapping(value = "/report", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
72 |
|
public ResponseEntity<byte[]> report(@ApiParam(value = "List of environments to extract info for and compared against reference environment", required = true) @RequestBody ReportParam param) throws DeploymentAuditException {
|
|
|
74 |
|
public ResponseEntity<byte[]> report(
|
|
75 |
|
@ApiParam(value = "List of environments to extract info for and compared against reference environment", required = true) @RequestBody ReportParam param)
|
|
76 |
|
throws DeploymentAuditException {
|
73 |
77 |
LOGGER.debug("Enter class: {} method: {}", this.getClass().getSimpleName(), "report");
|
LOGGER.debug("Enter class: {} method: {}", this.getClass().getSimpleName(), "report");
|
74 |
78 |
byte[] data = deploymentAuditService.createReport(param.getReferenceEnv(), param.getReportingEnv());
|
byte[] data = deploymentAuditService.createReport(param.getReferenceEnv(), param.getReportingEnv());
|
75 |
79 |
LOGGER.debug("Exit class: {} method: {}", this.getClass().getSimpleName(), "report");
|
LOGGER.debug("Exit class: {} method: {}", this.getClass().getSimpleName(), "report");
|
76 |
|
return ResponseEntity.status(HttpStatus.CREATED).header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + deploymentAuditService.getReportFileName()).contentLength(data.length).body(data);
|
|
|
80 |
|
return ResponseEntity.status(HttpStatus.CREATED)
|
|
81 |
|
.header(HttpHeaders.CONTENT_DISPOSITION,
|
|
82 |
|
"attachment;filename=" + deploymentAuditService.getReportFileName())
|
|
83 |
|
.contentLength(data.length).body(data);
|
77 |
84 |
}
|
}
|
78 |
85 |
|
|
79 |
86 |
@ApiOperation("To build snapshot")
|
@ApiOperation("To build snapshot")
|
80 |
|
@ApiResponses(value = { @ApiResponse(code = 201, message = "Success", response = Byte[].class), @ApiResponse(code = 400, message = "Invalid request parameterts", response = AuditError.class) })
|
|
81 |
|
@PostMapping(value = "/build/snapshot/{tier}", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
|
82 |
|
public ResponseEntity<byte[]> buildSnapshot(@ApiParam(value = "Tier name to create snapshot", required = true) @PathVariable("tier") String tier) throws DeploymentAuditException {
|
|
|
87 |
|
@ApiResponses(value = { @ApiResponse(code = 201, message = "Success", response = Byte[].class),
|
|
88 |
|
@ApiResponse(code = 400, message = "Invalid request parameterts", response = AuditError.class) })
|
|
89 |
|
@PostMapping(value = "/build/snapshot", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
|
90 |
|
public ResponseEntity<byte[]> buildSnapshot() throws DeploymentAuditException {
|
83 |
91 |
LOGGER.debug("Enter class: {} method: {}", this.getClass().getSimpleName(), "report");
|
LOGGER.debug("Enter class: {} method: {}", this.getClass().getSimpleName(), "report");
|
84 |
|
deploymentAuditService.createSnapshot(tier);
|
|
|
92 |
|
deploymentAuditService.createSnapshot();
|
85 |
93 |
LOGGER.debug("Exit class: {} method: {}", this.getClass().getSimpleName(), "report");
|
LOGGER.debug("Exit class: {} method: {}", this.getClass().getSimpleName(), "report");
|
86 |
94 |
return ResponseEntity.status(HttpStatus.CREATED).build();
|
return ResponseEntity.status(HttpStatus.CREATED).build();
|
87 |
95 |
}
|
}
|
File src/main/java/com/kingfisher/deployment/audit/data/builder/DeploymentStatusBuidler.java changed (mode: 100644) (index ec099ec..77af0ce) |
... |
... |
import java.util.ArrayList; |
6 |
6 |
import java.util.Collections;
|
import java.util.Collections;
|
7 |
7 |
import java.util.Date;
|
import java.util.Date;
|
8 |
8 |
import java.util.List;
|
import java.util.List;
|
|
9 |
|
import java.util.concurrent.ExecutorService;
|
|
10 |
|
import java.util.concurrent.Executors;
|
|
11 |
|
import java.util.concurrent.ThreadPoolExecutor;
|
9 |
12 |
|
|
10 |
13 |
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
11 |
14 |
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
|
... |
... |
public class DeploymentStatusBuidler { |
38 |
41 |
@Autowired
|
@Autowired
|
39 |
42 |
PasswordCodec passwordCodec;
|
PasswordCodec passwordCodec;
|
40 |
43 |
|
|
|
44 |
|
public static ExecutorService pool = Executors.newFixedThreadPool(20);
|
|
45 |
|
public static ExecutorService instancePool = Executors.newFixedThreadPool(20);
|
|
46 |
|
|
41 |
47 |
public Deployment build(JenkinsDeploymentStatus jenkinsDeploymentStatus) throws DeploymentAuditException {
|
public Deployment build(JenkinsDeploymentStatus jenkinsDeploymentStatus) throws DeploymentAuditException {
|
42 |
48 |
String applicationName = jenkinsDeploymentStatus.getApplicationName();
|
String applicationName = jenkinsDeploymentStatus.getApplicationName();
|
43 |
49 |
String environment = jenkinsDeploymentStatus.getEnvironment();
|
String environment = jenkinsDeploymentStatus.getEnvironment();
|
|
... |
... |
public class DeploymentStatusBuidler { |
65 |
71 |
deployedByUserId, createdByProcess);
|
deployedByUserId, createdByProcess);
|
66 |
72 |
}
|
}
|
67 |
73 |
|
|
68 |
|
public List<Deployment> getSnapshotFromIIB(final String tier) throws DeploymentAuditException {
|
|
|
74 |
|
public List<Deployment> getSnapshotFromIIB(final List<String> tiers) throws DeploymentAuditException {
|
|
75 |
|
|
|
76 |
|
List<Instance> instances = new ArrayList<>();
|
|
77 |
|
for (String tier : tiers) {
|
|
78 |
|
instances.addAll(instanceRepository.findByTier(tier));
|
|
79 |
|
}
|
69 |
80 |
List<Deployment> iibList = new ArrayList<>();
|
List<Deployment> iibList = new ArrayList<>();
|
70 |
|
List<Instance> instances = instanceRepository.findByTier(tier);
|
|
71 |
|
for (Instance instance : instances) {
|
|
72 |
|
IntegrationServers integrationServers = iibRestClient.getIntegrationServers(instance.getHost(),
|
|
73 |
|
instance.getApiPort(), instance.getApiUsername(), passwordCodec.decrypt(instance.getApiPassword()));
|
|
74 |
|
for (IntegrationServer integrationServer : integrationServers.getExecutionGroup()) {
|
|
75 |
|
Applications applications = iibRestClient.getApplications(integrationServer.getName(),
|
|
76 |
|
instance.getHost(), instance.getApiPort(), instance.getApiUsername(),
|
|
77 |
|
passwordCodec.decrypt(instance.getApiPassword()));
|
|
78 |
|
for (Application application : applications.getApplication()) {
|
|
79 |
|
IIBDeploymentStatus iibDeploymentStatus = iibRestClient.getDeployemntProperties(
|
|
80 |
|
integrationServer.getName(), application.getName(), instance.getHost(),
|
|
81 |
|
instance.getApiPort(), instance.getApiUsername(),
|
|
82 |
|
passwordCodec.decrypt(instance.getApiPassword()));
|
|
83 |
|
iibList.add(new Deployment(application.getName(), getBarFileName(iibDeploymentStatus),
|
|
84 |
|
instance.getTier(), instance.getInstanceName(), integrationServer.getName(),
|
|
85 |
|
getBarDeploymentTime(iibDeploymentStatus), new Date(),
|
|
86 |
|
getBarModifyTime(iibDeploymentStatus), getBarReleaseId(iibDeploymentStatus),
|
|
87 |
|
getBarCheckSum(iibDeploymentStatus), "api", "api", "snapshot"));
|
|
|
81 |
|
ThreadPoolExecutor executor = (ThreadPoolExecutor) pool;
|
|
82 |
|
ThreadPoolExecutor instanceExecutor = (ThreadPoolExecutor) instancePool;
|
|
83 |
|
|
|
84 |
|
Thread instanceThread = new Thread(new Runnable() {
|
|
85 |
|
|
|
86 |
|
@Override
|
|
87 |
|
public void run() {
|
|
88 |
|
for (Instance instance : instances) {
|
|
89 |
|
IntegrationServers integrationServers;
|
|
90 |
|
try {
|
|
91 |
|
integrationServers = iibRestClient.getIntegrationServers(instance.getHost(),
|
|
92 |
|
instance.getApiPort(), instance.getApiUsername(),
|
|
93 |
|
passwordCodec.decrypt(instance.getApiPassword()));
|
|
94 |
|
|
|
95 |
|
System.out.println("calling execute 1");
|
|
96 |
|
Thread t1 = new Thread(new Runnable() {
|
|
97 |
|
|
|
98 |
|
@Override
|
|
99 |
|
public void run() {
|
|
100 |
|
for (IntegrationServer integrationServer : integrationServers.getExecutionGroup()) {
|
|
101 |
|
Applications applications;
|
|
102 |
|
try {
|
|
103 |
|
applications = iibRestClient.getApplications(integrationServer.getName(),
|
|
104 |
|
instance.getHost(), instance.getApiPort(), instance.getApiUsername(),
|
|
105 |
|
passwordCodec.decrypt(instance.getApiPassword()));
|
|
106 |
|
System.out.println("calling execute 2");
|
|
107 |
|
Thread t2 = new Thread(new Runnable() {
|
|
108 |
|
@Override
|
|
109 |
|
public void run() {
|
|
110 |
|
for (Application application : applications.getApplication()) {
|
|
111 |
|
IIBDeploymentStatus iibDeploymentStatus;
|
|
112 |
|
try {
|
|
113 |
|
iibDeploymentStatus = iibRestClient.getDeployemntProperties(
|
|
114 |
|
integrationServer.getName(), application.getName(),
|
|
115 |
|
instance.getHost(), instance.getApiPort(),
|
|
116 |
|
instance.getApiUsername(),
|
|
117 |
|
passwordCodec.decrypt(instance.getApiPassword()));
|
|
118 |
|
|
|
119 |
|
iibList.add(new Deployment(application.getName(),
|
|
120 |
|
getBarFileName(iibDeploymentStatus), instance.getTier(),
|
|
121 |
|
instance.getInstanceName(), integrationServer.getName(),
|
|
122 |
|
getBarDeploymentTime(iibDeploymentStatus), new Date(),
|
|
123 |
|
getBarModifyTime(iibDeploymentStatus),
|
|
124 |
|
getBarReleaseId(iibDeploymentStatus),
|
|
125 |
|
getBarCheckSum(iibDeploymentStatus), "api", "api",
|
|
126 |
|
"snapshot"));
|
|
127 |
|
} catch (DeploymentAuditException e) {
|
|
128 |
|
e.printStackTrace();
|
|
129 |
|
}
|
|
130 |
|
}
|
|
131 |
|
|
|
132 |
|
}
|
|
133 |
|
});
|
|
134 |
|
pool.execute(t2);
|
|
135 |
|
|
|
136 |
|
} catch (DeploymentAuditException e) {
|
|
137 |
|
}
|
|
138 |
|
}
|
|
139 |
|
|
|
140 |
|
}
|
|
141 |
|
});
|
|
142 |
|
pool.execute(t1);
|
|
143 |
|
} catch (DeploymentAuditException e1) {
|
|
144 |
|
e1.printStackTrace();
|
|
145 |
|
}
|
|
146 |
|
|
88 |
147 |
}
|
}
|
|
148 |
|
|
|
149 |
|
}
|
|
150 |
|
});
|
|
151 |
|
instancePool.execute(instanceThread);
|
|
152 |
|
|
|
153 |
|
while (true) {
|
|
154 |
|
if (executor.getActiveCount() == 0 && instanceExecutor.getActiveCount() == 0) {
|
|
155 |
|
pool.shutdown();
|
|
156 |
|
instancePool.shutdown();
|
|
157 |
|
break;
|
89 |
158 |
}
|
}
|
90 |
159 |
}
|
}
|
|
160 |
|
System.out.println("calling shutdown");
|
|
161 |
|
|
91 |
162 |
return iibList;
|
return iibList;
|
|
163 |
|
|
92 |
164 |
}
|
}
|
93 |
165 |
|
|
94 |
166 |
public List<Deployment> compareDeploymentsAndRectify(final List<Deployment> iibList,
|
public List<Deployment> compareDeploymentsAndRectify(final List<Deployment> iibList,
|
File src/main/java/com/kingfisher/deployment/audit/repository/DeploymentRepository.java changed (mode: 100644) (index e39d0dd..ed3bc8d) |
... |
... |
import com.kingfisher.deployment.audit.model.Deployment; |
17 |
17 |
public interface DeploymentRepository extends JpaRepository<Deployment, Integer> {
|
public interface DeploymentRepository extends JpaRepository<Deployment, Integer> {
|
18 |
18 |
|
|
19 |
19 |
@Query(value = "select * from deployment where environment=:env and application_name=:app and exclude_from_report=0", nativeQuery = true)
|
@Query(value = "select * from deployment where environment=:env and application_name=:app and exclude_from_report=0", nativeQuery = true)
|
20 |
|
List<Deployment> findLatestDeploymentByApplicationNameAndEnvironment(@Param("env") String env, @Param("app") String app);
|
|
|
20 |
|
List<Deployment> findLatestDeploymentByApplicationNameAndEnvironment(@Param("env") String env,
|
|
21 |
|
@Param("app") String app);
|
21 |
22 |
|
|
22 |
23 |
@Query(value = "select distinct application_name from deployment where environment in :envs", nativeQuery = true)
|
@Query(value = "select distinct application_name from deployment where environment in :envs", nativeQuery = true)
|
23 |
24 |
List<String> findApplicationName(@Param("envs") List<String> environments);
|
List<String> findApplicationName(@Param("envs") List<String> environments);
|
|
... |
... |
public interface DeploymentRepository extends JpaRepository<Deployment, Integer> |
25 |
26 |
@Modifying(clearAutomatically = true)
|
@Modifying(clearAutomatically = true)
|
26 |
27 |
@Transactional
|
@Transactional
|
27 |
28 |
@Query(value = "update deployment set exclude_from_report=1 where application_name=:applicationName and instance_name=:instanceName and integration_server=:integrationServer and exclude_from_report=0", nativeQuery = true)
|
@Query(value = "update deployment set exclude_from_report=1 where application_name=:applicationName and instance_name=:instanceName and integration_server=:integrationServer and exclude_from_report=0", nativeQuery = true)
|
28 |
|
int hideFromReport(@Param("applicationName") String applicationName, @Param("instanceName") String instanceName, @Param("integrationServer") String integrationServer);
|
|
|
29 |
|
int hideFromReport(@Param("applicationName") String applicationName, @Param("instanceName") String instanceName,
|
|
30 |
|
@Param("integrationServer") String integrationServer);
|
29 |
31 |
|
|
30 |
|
Optional<Deployment> findByApplicationNameAndInstanceNameAndIntegrationServerAndBarDeploymentTime(String applicationName, String instanceName, String integrationServer, Date barDeploymentTime);
|
|
|
32 |
|
Optional<Deployment> findByApplicationNameAndInstanceNameAndIntegrationServerAndBarDeploymentTime(
|
|
33 |
|
String applicationName, String instanceName, String integrationServer, Date barDeploymentTime);
|
31 |
34 |
|
|
32 |
35 |
@Query(value = "select * from deployment where exclude_from_report=0 and environment=:tier", nativeQuery = true)
|
@Query(value = "select * from deployment where exclude_from_report=0 and environment=:tier", nativeQuery = true)
|
33 |
36 |
List<Deployment> findAllInReport(@Param("tier") String tier);
|
List<Deployment> findAllInReport(@Param("tier") String tier);
|
|
37 |
|
|
|
38 |
|
@Query(value = "select tier from snapshot_config where snapshot=1", nativeQuery = true)
|
|
39 |
|
List<String> findAllSnapshotActiveTier();
|
34 |
40 |
}
|
}
|
File src/test/java/com/kingfisher/deployment/audit/test/smoke/DeploymentAuditControllerTest.java changed (mode: 100644) (index c35dff1..f8c4494) |
... |
... |
public class DeploymentAuditControllerTest { |
46 |
46 |
String deployedByUserName = "test user";
|
String deployedByUserName = "test user";
|
47 |
47 |
String deployedByUserId = "TEST_USER";
|
String deployedByUserId = "TEST_USER";
|
48 |
48 |
String createdByProcess = "auto test";
|
String createdByProcess = "auto test";
|
49 |
|
JenkinsDeploymentStatus jenkinsDeploymentStatus = new JenkinsDeploymentStatus(applicationName, environment, instanceName, integrationServer, deployedByUserName, deployedByUserId, createdByProcess);
|
|
|
49 |
|
JenkinsDeploymentStatus jenkinsDeploymentStatus = new JenkinsDeploymentStatus(applicationName, environment,
|
|
50 |
|
instanceName, integrationServer, deployedByUserName, deployedByUserId, createdByProcess);
|
50 |
51 |
List<JenkinsDeploymentStatus> JenkinsDeploymentStatuses = new ArrayList<>();
|
List<JenkinsDeploymentStatus> JenkinsDeploymentStatuses = new ArrayList<>();
|
51 |
52 |
JenkinsDeploymentStatuses.add(jenkinsDeploymentStatus);
|
JenkinsDeploymentStatuses.add(jenkinsDeploymentStatus);
|
52 |
53 |
|
|
53 |
|
this.mockMvc.perform(post("/v1/deployments").contentType(ApplicationConstant.CONTENT_TYPE_APPLICATION_JSON).content(IntegrationTestUtil.convertObjectToJsonString(JenkinsDeploymentStatuses))).andDo(print()).andExpect(status().isCreated());
|
|
|
54 |
|
this.mockMvc
|
|
55 |
|
.perform(post("/v1/deployments").contentType(ApplicationConstant.CONTENT_TYPE_APPLICATION_JSON)
|
|
56 |
|
.content(IntegrationTestUtil.convertObjectToJsonString(JenkinsDeploymentStatuses)))
|
|
57 |
|
.andDo(print()).andExpect(status().isCreated());
|
54 |
58 |
}
|
}
|
55 |
59 |
|
|
56 |
60 |
@Test
|
@Test
|
|
... |
... |
public class DeploymentAuditControllerTest { |
60 |
64 |
List<String> reportingEnv = Arrays.asList(new String[] { "F", "V" });
|
List<String> reportingEnv = Arrays.asList(new String[] { "F", "V" });
|
61 |
65 |
ReportParam reportParam = new ReportParam(referenceEnv, reportingEnv);
|
ReportParam reportParam = new ReportParam(referenceEnv, reportingEnv);
|
62 |
66 |
|
|
63 |
|
this.mockMvc.perform(post("/v1/deployments/report").contentType(ApplicationConstant.CONTENT_TYPE_APPLICATION_JSON).content(IntegrationTestUtil.convertObjectToJsonString(reportParam))).andDo(print()).andExpect(status().isCreated());
|
|
|
67 |
|
this.mockMvc
|
|
68 |
|
.perform(post("/v1/deployments/report").contentType(ApplicationConstant.CONTENT_TYPE_APPLICATION_JSON)
|
|
69 |
|
.content(IntegrationTestUtil.convertObjectToJsonString(reportParam)))
|
|
70 |
|
.andDo(print()).andExpect(status().isCreated());
|
|
71 |
|
}
|
|
72 |
|
|
|
73 |
|
@Test
|
|
74 |
|
@WithMockUser(username = MOCK_AUDITOR_USERNAME, password = MOCK_AUDITOR_PASSWORD, roles = ApplicationConstant.SECURITY_ROLE_AUDITOR)
|
|
75 |
|
public void testBuildingSnapshot() throws Exception {
|
|
76 |
|
this.mockMvc.perform(post("/v1/deployments/build/snapshot")).andDo(print()).andExpect(status().isCreated());
|
64 |
77 |
}
|
}
|
65 |
78 |
} |
} |