#100 - Ignore Milestone.open property.

We now no longer render the open property of a GitHub Milestone as JSON.

Previously, the open property was rejected by the GitHub API validator.
This commit is contained in:
Mark Paluch
2019-02-13 12:13:51 +01:00
parent e4bf393e80
commit ea6625cfee
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.release.issues.github;
import static org.assertj.core.api.Assertions.*;
import java.io.IOException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework.data.release.issues.github.GitHubIssue.Milestone;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Unit tests for {@link GitHubIssue}.
*
* @author Mark Paluch
*/
@RunWith(SpringRunner.class)
@JsonTest
public class GitHubIssueUnitTests {
@Autowired private JacksonTester<Milestone> json;
@Test
public void shouldNotRenderOpenProperty() throws IOException {
Milestone milestone = Milestone.of("my-title", "my-description");
assertThat(this.json.write(milestone)) //
.hasJsonPathStringValue("@.title", "my-title") //
.hasJsonPathStringValue("@.description", "my-description") //
.doesNotHaveJsonPathValue("@.open");
}
}