Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
Make UpdateStatus.completedAt nullable
Browse files Browse the repository at this point in the history
Add unit test.
Fixes #832
  • Loading branch information
davidxia committed Jul 20, 2017
1 parent 8d74b92 commit 47e8201
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public abstract class Service {
@JsonProperty("Endpoint")
public abstract Endpoint endpoint();

@JsonProperty("UpdateStatus")
@Nullable
@JsonProperty("UpdateStatus")
public abstract UpdateStatus updateStatus();

@AutoValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public abstract class UpdateStatus {
@JsonProperty("StartedAt")
public abstract Date startedAt();

@Nullable
@JsonProperty("CompletedAt")
public abstract Date completedAt();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.spotify.docker.client.messages.swarm;

import static com.spotify.docker.FixtureUtil.fixture;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.spotify.docker.client.ObjectMapperProvider;

import org.junit.Test;

public class ServiceTest {

private final ObjectMapper objectMapper = ObjectMapperProvider.objectMapper();

@Test
public void test1_30() throws Exception {
objectMapper.readValue(fixture("fixtures/1.30/service.json"), Service.class);
}

}
84 changes: 84 additions & 0 deletions src/test/resources/fixtures/1.30/service.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"ID": "9mnpnzenvg8p8tdbtq4wvbkcz",
"Version": {
"Index": 19
},
"CreatedAt": "2016-06-07T21:05:51.880065305Z",
"UpdatedAt": "2016-06-07T21:07:29.962229872Z",
"Spec": {
"Name": "hopeful_cori",
"TaskTemplate": {
"ContainerSpec": {
"Image": "redis"
},
"Resources": {
"Limits": {},
"Reservations": {}
},
"RestartPolicy": {
"Condition": "any",
"MaxAttempts": 0
},
"Placement": {},
"ForceUpdate": 0
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"UpdateConfig": {
"Parallelism": 1,
"Delay": 1000000000,
"FailureAction": "pause",
"Monitor": 15000000000,
"MaxFailureRatio": 0.15
},
"RollbackConfig": {
"Parallelism": 1,
"Delay": 1000000000,
"FailureAction": "pause",
"Monitor": 15000000000,
"MaxFailureRatio": 0.15
},
"EndpointSpec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 6379,
"PublishedPort": 30001
}
]
}
},
"Endpoint": {
"Spec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 6379,
"PublishedPort": 30001
}
]
},
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 6379,
"PublishedPort": 30001
}
],
"VirtualIPs": [
{
"NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
"Addr": "10.255.0.2/16"
},
{
"NetworkID": "4qvuz4ko70xaltuqbt8956gd1",
"Addr": "10.255.0.3/16"
}
]
}
}

0 comments on commit 47e8201

Please sign in to comment.