1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2025-01-21 12:03:28 +02:00

Отказ от генератора toString

При добавлении генератора в Secrets ломается вывод JobConfiguration
This commit is contained in:
Nikita Gryzlov 2020-04-03 18:11:00 +03:00
parent aae6f782b6
commit 6d34a97591
No known key found for this signature in database
GPG Key ID: C1EAE411FEF0BF2F
3 changed files with 15 additions and 5 deletions

View File

@ -2,8 +2,6 @@ package ru.pulsar.jenkins.library.configuration
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import com.fasterxml.jackson.annotation.JsonPropertyDescription
import org.apache.commons.lang3.builder.ReflectionToStringBuilder
import org.apache.commons.lang3.builder.ToStringStyle
@JsonIgnoreProperties(ignoreUnknown = true)
class JobConfiguration implements Serializable {
@ -18,6 +16,10 @@ class JobConfiguration implements Serializable {
@Override
String toString() {
return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE)
return "JobConfiguration{" +
"v8version='" + v8version + '\'' +
", sonarScannerToolName='" + sonarScannerToolName + '\'' +
", secrets=" + secrets.toString() +
'}';
}
}

View File

@ -12,4 +12,12 @@ class Secrets implements Serializable {
@JsonPropertyDescription("Данные авторизации в хранилище конфигурации")
String storage
@Override
String toString() {
return "Secrets{" +
"storagePath='" + storagePath + '\'' +
", storage='" + storage + '\'' +
'}';
}
}

View File

@ -71,7 +71,7 @@ class jobConfigurationTest {
workflowJob.definition = flow
def run = rule.buildAndAssertSuccess(workflowJob)
rule.assertLogContains('"v8version":"8.3.12.1500"', run)
rule.assertLogContains('"sonarScannerToolName":"sonar-scanner"', run)
rule.assertLogContains("v8version='8.3.12.1500'", run)
rule.assertLogContains("sonarScannerToolName='sonar-scanner'", run)
}
}