Skip to content

Commit

Permalink
EPMRPP-92477 rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx committed Jul 8, 2024
1 parent ca8085a commit 940a5b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class DefectUpdateStatisticsJob extends BaseJob {
private final RestTemplate restTemplate;

private final String measurementId;
private final String apiSecret;
private final String gaId;


/**
Expand All @@ -73,11 +73,11 @@ public class DefectUpdateStatisticsJob extends BaseJob {
@Autowired
public DefectUpdateStatisticsJob(JdbcTemplate jdbcTemplate,
@Value("${rp.environment.variable.ga.measurementId}") String measurementId,
@Value("${rp.environment.variable.ga.apiSecret}") String apiSecret,
@Value("${rp.environment.variable.ga.id}") String gaId,
NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
super(jdbcTemplate);
this.measurementId = measurementId;
this.apiSecret = apiSecret;
this.gaId = gaId;
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
this.restTemplate = new RestTemplate();
}
Expand All @@ -92,9 +92,9 @@ public DefectUpdateStatisticsJob(JdbcTemplate jdbcTemplate,
@Transactional
public void execute() {
LOGGER.info("Start sending items defect update statistics");
if (StringUtils.isEmpty(measurementId) || StringUtils.isEmpty(apiSecret)) {
if (StringUtils.isEmpty(measurementId) || StringUtils.isEmpty(gaId)) {
LOGGER.info(
"Both 'measurementId' and 'apiSecret' environment variables should be provided in order to run the job 'defectUpdateStatisticsJob'");
"Both 'measurementId' and 'gaId' environment variables should be provided in order to run the job 'defectUpdateStatisticsJob'");
return;
}

Expand Down Expand Up @@ -179,7 +179,7 @@ private void sendRequest(JSONObject requestBody) {
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> request = new HttpEntity<>(requestBody.toString(), headers);

String url = String.format(GA_URL, measurementId, apiSecret);
String url = String.format(GA_URL, measurementId, gaId);

var response = restTemplate.exchange(url, POST, request, String.class);
if (response.getStatusCodeValue() != 204) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rp:
## 1 minute
cron: '0 */1 * * * *'
ga:
apiSecret:
id:
measurementId:
cron: '0 0 */24 * * *'
executor:
Expand Down

0 comments on commit 940a5b1

Please sign in to comment.