Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions integrations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
<artifactId>gitlab-branch-source</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>jackson3-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>joda-time-api</artifactId>
Expand Down Expand Up @@ -194,11 +199,6 @@
<artifactId>gitlab-plugin</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jdk-tool</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions test-harness/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
<groupId>io.jenkins.plugins</groupId>
<artifactId>jackson3-api</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import hudson.ExtensionList;
import io.jenkins.plugins.casc.ConfigurationAsCode;
import io.jenkins.plugins.casc.ConfigurationContext;
Expand Down Expand Up @@ -40,6 +37,8 @@
import org.jvnet.hudson.test.LogRecorder;
import org.jvnet.hudson.test.LoggerRule;
import org.yaml.snakeyaml.nodes.Node;
import tools.jackson.databind.ObjectMapper;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change will need testing in bom to make sure its compatible for fixes are staged to downstream plugins

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this PR is green I'm running bom tests on jenkinsci/bom#6451

import tools.jackson.dataformat.yaml.YAMLMapper;

public class Util {

Expand Down Expand Up @@ -252,15 +251,11 @@ public static void assertLogContains(LogRecorder logging, String expectedText) {
* @return the json conversion of the yaml string.
*/
public static String convertToJson(String yamlString) {
try {
ObjectMapper yamlReader = new ObjectMapper(new YAMLFactory());
Object obj = yamlReader.readValue(yamlString, Object.class);
ObjectMapper yamlReader = new YAMLMapper();
Object obj = yamlReader.readValue(yamlString, Object.class);

ObjectMapper jsonWriter = new ObjectMapper();
return jsonWriter.writeValueAsString(obj);
} catch (JsonProcessingException e) {
throw new UncheckedIOException(e);
}
ObjectMapper jsonWriter = new ObjectMapper();
return jsonWriter.writeValueAsString(obj);
}

/**
Expand Down
Loading