Response response = httpClient.post(payload);
int statusCode = response.getStatus();
- if (statusCode != HttpStatus.SC_OK) {
+ if (statusCode == HttpStatus.SC_UNPROCESSABLE_ENTITY) {
- logger.warn("{} {} {}", "ActivitySpec", activitySpec.getName(), "already exists in SDC");
++ logger.warn(Strings.repeat("{} ", 3), "ActivitySpec", activitySpec.getName(), "already exists in SDC");
+ } else if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_CREATED) {
- logger.warn("{} {} {}", "Error creating activity spec", activitySpec.getName(), statusCode);
+ logger.warn(Strings.repeat("{} ", 3), "Error creating activity spec", activitySpec.getName(),
+ statusCode);
} else {
if (response.getEntity() != null) {
ActivitySpecCreateResponse activitySpecCreateResponse =
int statusCode = response.getStatus();
- if (statusCode != HttpStatus.SC_OK) {
+ if (statusCode == HttpStatus.SC_UNPROCESSABLE_ENTITY) {
- logger.warn("{} {} {}", "ActivitySpec with id", activitySpecId, "is already certified in SDC");
++ logger.warn(Strings.repeat("{} ", 3), "ActivitySpec with id", activitySpecId,
++ "is already certified in SDC");
+ } else if (statusCode != HttpStatus.SC_OK) {
- logger.warn("{} {} {}", "Error certifying activity", activitySpecId, statusCode);
+ logger.warn(Strings.repeat("{} ", 3), "Error certifying activity", activitySpecId, statusCode);
} else {
certificationResult = true;
}