Skip to content

Bump jackson from 1.x to 2.x #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- [#185](https://github.com/javaswift/joss/pull/185): Bump jackson from 1.x to 2.x, target JDK from 1.6 to 1.8 [@didot](https://github.com/didot) [#175](https://github.com/javaswift/joss/issues/175)

## [0.10.3](https://github.com/javaswift/joss/releases/tag/v0.10.3) - 2019-05-20
### Changed
- [#156](https://github.com/javaswift/joss/pull/156): Adds support for KeystoneV3 scoping during auth [@tfelix](https://github.com/tfelix) [#155](https://github.com/javaswift/joss/issues/155)
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<commons.lang.version>2.6</commons.lang.version>
<commons.io.version>2.3</commons.io.version>
<httpcomponents.version>4.5.3</httpcomponents.version>
<jackson.version>1.9.7</jackson.version>
<jackson.version>2.11.3</jackson.version>
<junit.version>4.10</junit.version>
<mockit.version>1.6</mockit.version>
<slf4j.version>1.7.2</slf4j.version>
Expand All @@ -62,8 +62,8 @@

<!-- Used for marshalling to / unmarshalling from JSON -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>

Expand Down Expand Up @@ -147,8 +147,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import java.util.List;
import java.util.concurrent.Callable;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.util.EntityUtils;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.javaswift.joss.command.impl.core.httpstatus.HttpStatusChecker;
import org.javaswift.joss.exception.CommandException;
import org.javaswift.joss.headers.Header;
Expand Down Expand Up @@ -136,9 +136,9 @@ protected void modifyURI(QueryParameters queryParameters) {
protected ObjectMapper createObjectMapper(boolean dealWithRootValue) {
ObjectMapper objectMapper = new ObjectMapper();
if (dealWithRootValue) {
objectMapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
objectMapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
objectMapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
objectMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
objectMapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
}
return objectMapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import java.io.IOException;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.javaswift.joss.client.factory.AccountConfig;
import org.javaswift.joss.command.impl.core.AbstractCommand;
import org.javaswift.joss.command.impl.core.httpstatus.HttpStatusChecker;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.account;

import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

public class ContainerListElement {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.container;

import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

public class StoredObjectListElement {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.javaswift.joss.command.shared.identity.access;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.map.annotate.JsonRootName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonRootName;
import org.javaswift.joss.client.factory.TempUrlHashPrefixSource;

@JsonRootName(value="access")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonRootName;
import org.apache.http.HttpStatus;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.map.annotate.JsonRootName;
import org.javaswift.joss.client.factory.TempUrlHashPrefixSource;
import org.javaswift.joss.exception.CommandExceptionError;
import org.javaswift.joss.exception.HttpStatusExceptionUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.access;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class EndPoint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.LinkedHashMap;
import java.util.Map;

import org.codehaus.jackson.JsonNode;
import com.fasterxml.jackson.databind.JsonNode;
import org.javaswift.joss.client.factory.TempUrlHashPrefixSource;
import org.javaswift.joss.model.Access;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.javaswift.joss.command.shared.identity.access;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Metadata {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.access;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Role {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.javaswift.joss.command.shared.identity.access;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class ServiceCatalog {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.access;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Tenant {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.access;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Token {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.javaswift.joss.command.shared.identity.access;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class User {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.javaswift.joss.command.shared.identity.authentication;

import org.codehaus.jackson.map.annotate.JsonRootName;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonRootName;

@JsonRootName(value="auth")
public class Authentication {
Expand All @@ -16,12 +15,12 @@ public Authentication(final String tenantName, String tenantId, final String use
this.tenantId = tenantId;
}

@JsonSerialize(include=Inclusion.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public String getTenantId() {
return this.tenantId;
}

@JsonSerialize(include=Inclusion.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public String getTenantName() {
return this.tenantName;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.authentication;

import org.codehaus.jackson.map.annotate.JsonRootName;
import com.fasterxml.jackson.annotation.JsonRootName;

@JsonRootName(value="auth")
public class KeystoneV3Authentication {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.authentication;

import org.codehaus.jackson.annotate.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnore;

public class KeystoneV3PasswordIdentity {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.javaswift.joss.command.shared.identity.tenant;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Tenant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.javaswift.joss.exception.CommandException;

@JsonIgnoreProperties(ignoreUnknown = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.io.IOException;

import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.javaswift.joss.command.shared.account.ContainerListElement;
import org.javaswift.joss.util.ClasspathTemplateResource;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.javaswift.joss.client.factory.TempUrlHashPrefixSource;
import org.javaswift.joss.exception.CommandExceptionError;
import org.javaswift.joss.exception.NotFoundException;
Expand All @@ -23,7 +23,7 @@ public class AccessTest {
public void testUnmarshalling() throws IOException {
String jsonString = new ClasspathTemplateResource("/sample-access.json").loadTemplate();
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
Access access = mapper.readValue(jsonString, AccessTenant.class);
assertEquals("a376b74fbdb64a4986cd3234647ff6f8", access.getToken());
assertEquals("https://og.cloudvps.com:443/v1/AUTH_bfo000024", access.getInternalURL());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static org.junit.Assert.assertEquals;

import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Before;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

import java.io.IOException;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.junit.Test;

public class AuthenticationTest {

@Test
public void testMarshalling() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
Authentication auth = new Authentication("testtenant", "testtenantid", "testuser", "testpassword");
assertEquals("{\"auth\":{\"passwordCredentials\":{\"username\":\"testuser\",\"password\":\"testpassword\"},\"tenantName\":\"testtenant\",\"tenantId\":\"testtenantid\"}}", mapper.writeValueAsString(auth));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

import java.io.IOException;

import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.junit.Test;

public class KeystoneV3AuthenticationTest {

@Test
public void testMarshallingDefaultScope() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);

KeystoneV3Authentication authentication = new KeystoneV3Authentication();
authentication.setIdentity(new KeystoneV3Identity("username", "password", "domainName"));
Expand All @@ -33,8 +33,8 @@ public void testMarshallingDefaultScope() throws IOException {
@Test
public void testMarshallingDomainScope() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);

KeystoneV3Authentication authentication = new KeystoneV3Authentication();
authentication.setIdentity(new KeystoneV3Identity("username", "password", "domainName"));
Expand All @@ -52,8 +52,8 @@ public void testMarshallingDomainScope() throws IOException {
@Test
public void testMarshallingProjectScope() throws IOException {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);

KeystoneV3Authentication authentication = new KeystoneV3Authentication();
authentication.setIdentity(new KeystoneV3Identity("username", "password", "domainName"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.io.IOException;

import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.javaswift.joss.exception.CommandException;
import org.junit.Test;

Expand Down