Skip to content

Commit a360310

Browse files
authored
Resolve remaining compatibility issues required to upgrade jackson (#89)
* Resolve remaining compatibility issues required to upgrade jackson * migrate from travisCI to github workflows * migrate from travisCI to github workflows
1 parent 992390b commit a360310

File tree

8 files changed

+61
-25
lines changed

8 files changed

+61
-25
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI Test Suite
2+
3+
# Triggers the workflow on pull requests, manually, or pushes to master
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
workflow_dispatch:
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
# This workflow contains a single job called "build"
14+
build:
15+
# The type of runner that the job will run on
16+
runs-on: ubuntu-latest
17+
18+
# Steps represent a sequence of tasks that will be executed as part of the job
19+
steps:
20+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
21+
- uses: actions/checkout@v2
22+
23+
## Run tests against Open JDK8
24+
- uses: actions/setup-java@v2
25+
with:
26+
distribution: adopt
27+
java-version: 8
28+
29+
## Cache maven dependencies
30+
- name: Cache local Maven repository
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.m2/repository
34+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
35+
restore-keys: |
36+
${{ runner.os }}-maven-
37+
38+
## Run CheckStyle and License Header checks, compile, and install locally
39+
- name: Run checkstyle, license check, compile and install locally
40+
run: mvn clean install -DskipTests=true -DskipCheckStyle=false -Dmaven.javadoc.skip=true -B -V
41+
42+
## Run test suite
43+
- name: Run test suite
44+
run: mvn test -B -DskipCheckStyle=true -Dmaven.javadoc.skip=true

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
The format is based on [Keep a Changelog](http://keepachangelog.com/)
33
and this project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 4.0.1 (UNRELEASED)
6+
#### Internal Dependency Updates
7+
- Upgraded Jackson from version 2.11.4 to 2.13.1.
8+
9+
510
## 4.0.0 (06/03/2021)
611

712
### NOTE: Breaking Change

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Pardot Java API Client
22

3-
[![Build Status](https://travis-ci.org/Crim/pardot-java-client.svg?branch=master)](https://travis-ci.org/Crim/pardot-java-client)
4-
53
## What is it?
64

75
This library is a fluent style API client for Pardot's API (version 3 and 4).

pom.xml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.darksci</groupId>
88
<artifactId>pardot-api-client</artifactId>
9-
<version>4.0.0</version>
9+
<version>4.0.1</version>
1010
<packaging>jar</packaging>
1111

1212
<!-- Require Maven 3.5.0 -->
@@ -47,7 +47,7 @@
4747
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4848

4949
<!-- Jackson version -->
50-
<jackson.version>2.11.4</jackson.version>
50+
<jackson.version>2.13.1</jackson.version>
5151

5252
<!-- Define which version of junit you'll be running -->
5353
<junit.version>4.13.2</junit.version>
@@ -237,18 +237,9 @@
237237
<version>3.0</version>
238238
<configuration>
239239
<header>LICENSE.txt</header>
240-
<excludes>
241-
<exclude>**/.md</exclude>
242-
<exclude>**.MD</exclude>
243-
<exclude>**/.bak</exclude>
244-
<exclude>**.yml</exclude>
245-
<exclude>**.yaml</exclude>
246-
<exclude>**.xml</exclude>
247-
<exclude>build/**</exclude>
248-
<exclude>src/test/resources/**</exclude>
249-
<exclude>src/main/resources/**</exclude>
250-
<exclude>LICENSE.txt</exclude>
251-
</excludes>
240+
<includes>
241+
<include>**/**.java</include>
242+
</includes>
252243
</configuration>
253244
<executions>
254245
<execution>

src/main/java/com/darksci/pardot/api/parser/JacksonFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.fasterxml.jackson.databind.json.JsonMapper;
2525
import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
2626
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
27+
import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
2728
import com.fasterxml.jackson.datatype.joda.JodaModule;
2829

2930
import java.text.SimpleDateFormat;
@@ -66,6 +67,8 @@ public static XmlMapper newInstance() {
6667
module.addDeserializer(ProspectCustomFieldValue.class, new ProspectCustomFieldDeserializer());
6768

6869
final XmlMapper mapper = new XmlMapper(module);
70+
// Coerce fields marked as <fieldName/> into NULL to maintain backwards compatibility.
71+
mapper.enable(FromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL);
6972

7073
// Configure it
7174
mapper

src/test/java/com/darksci/pardot/api/parser/list/ListReadResponseParserTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ public void testRead() throws IOException {
4646
assertEquals("Has correct name", "Stevie Only List", list.getName());
4747
assertEquals("Has correct isPublic", false, list.getIsPublic());
4848
assertEquals("Has correct isDynamic", false, list.getIsDynamic());
49+
// tags like <title/> should be null
4950
assertNull("Has correct title", list.getTitle());
50-
assertNull("Has correct description", list.getDescription());
51+
// tags like <description></description> should be empty string
52+
assertEquals("Has correct description", "", list.getDescription());
5153
assertEquals("Has correct isCrmVisible", false, list.getIsCrmVisible());
5254
assertEquals("Has correct createdAt", "2017-08-11T22:03:22.000", list.getCreatedAt().toString());
5355
assertEquals("Has correct updatedAt", "2017-08-11T22:03:22.000", list.getUpdatedAt().toString());

src/test/resources/mockResponses/listRead.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<is_public>false</is_public>
77
<is_dynamic>false</is_dynamic>
88
<title/>
9-
<description/>
9+
<description></description>
1010
<is_crm_visible>false</is_crm_visible>
1111
<created_at>2017-08-11 22:03:22</created_at>
1212
<updated_at>2017-08-11 22:03:22</updated_at>

0 commit comments

Comments
 (0)