Skip to content

Commit 1e148a3

Browse files
authored
✅ Update dependencies and refactor to JUnit 5 (#30)
* Update dependencies and refactor to JUnit 5. * Add back nested class properties to fix broken tests * Use static import for Assertions methods. * Add .editorconfig file for per-project code style configuration. * Fix indentation inconsistency.
1 parent f2834e1 commit 1e148a3

11 files changed

+499
-284
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
9+
# Indentation style for Java
10+
[*.java]
11+
charset = utf-8
12+
indent_style = space
13+
indent_size = 4

.gitignore

Lines changed: 194 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,195 @@
1-
target/
1+
# Created by https://www.toptal.com/developers/gitignore/api/java,maven,eclipse,intellij+all,code-java
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=java,maven,eclipse,intellij+all,code-java
3+
4+
### Code-Java ###
5+
# Language Support for Java(TM) by Red Hat extension for Visual Studio Code - https://marketplace.visualstudio.com/items?itemName=redhat.java
6+
7+
.project
8+
.classpath
9+
factoryConfiguration.json
10+
11+
### Eclipse ###
12+
.metadata
13+
bin/
14+
tmp/
15+
*.tmp
16+
*.bak
17+
*.swp
18+
*~.nib
19+
local.properties
20+
.settings/
21+
.loadpath
22+
.recommenders
23+
24+
# External tool builders
25+
.externalToolBuilders/
26+
27+
# Locally stored "Eclipse launch configurations"
28+
*.launch
29+
30+
# PyDev specific (Python IDE for Eclipse)
31+
*.pydevproject
32+
33+
# CDT-specific (C/C++ Development Tooling)
34+
.cproject
35+
36+
# CDT- autotools
37+
.autotools
38+
39+
# Java annotation processor (APT)
40+
.factorypath
41+
42+
# PDT-specific (PHP Development Tools)
43+
.buildpath
44+
45+
# sbteclipse plugin
46+
.target
47+
48+
# Tern plugin
49+
.tern-project
50+
51+
# TeXlipse plugin
52+
.texlipse
53+
54+
# STS (Spring Tool Suite)
55+
.springBeans
56+
57+
# Code Recommenders
58+
.recommenders/
59+
60+
# Annotation Processing
61+
.apt_generated/
62+
.apt_generated_test/
63+
64+
# Scala IDE specific (Scala & Java development for Eclipse)
65+
.cache-main
66+
.scala_dependencies
67+
.worksheet
68+
69+
# Uncomment this line if you wish to ignore the project description file.
70+
# Typically, this file would be tracked if it contains build/dependency configurations:
71+
#.project
72+
73+
### Eclipse Patch ###
74+
# Spring Boot Tooling
75+
.sts4-cache/
76+
77+
### Intellij+all ###
78+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
79+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
80+
81+
# User-specific stuff
82+
.idea/**/workspace.xml
83+
.idea/**/tasks.xml
84+
.idea/**/usage.statistics.xml
85+
.idea/**/dictionaries
86+
.idea/**/shelf
87+
88+
# Generated files
89+
.idea/**/contentModel.xml
90+
91+
# Sensitive or high-churn files
92+
.idea/**/dataSources/
93+
.idea/**/dataSources.ids
94+
.idea/**/dataSources.local.xml
95+
.idea/**/sqlDataSources.xml
96+
.idea/**/dynamic.xml
97+
.idea/**/uiDesigner.xml
98+
.idea/**/dbnavigator.xml
99+
100+
# Gradle
101+
.idea/**/gradle.xml
102+
.idea/**/libraries
103+
104+
# Gradle and Maven with auto-import
105+
# When using Gradle or Maven with auto-import, you should exclude module files,
106+
# since they will be recreated, and may cause churn. Uncomment if using
107+
# auto-import.
108+
# .idea/artifacts
109+
# .idea/compiler.xml
110+
# .idea/jarRepositories.xml
111+
# .idea/modules.xml
112+
# .idea/*.iml
113+
# .idea/modules
114+
# *.iml
115+
# *.ipr
116+
117+
# CMake
118+
cmake-build-*/
119+
120+
# Mongo Explorer plugin
121+
.idea/**/mongoSettings.xml
122+
123+
# File-based project format
124+
*.iws
125+
126+
# IntelliJ
127+
out/
128+
129+
# mpeltonen/sbt-idea plugin
130+
.idea_modules/
131+
132+
# JIRA plugin
133+
atlassian-ide-plugin.xml
134+
135+
# Cursive Clojure plugin
136+
.idea/replstate.xml
137+
138+
# Crashlytics plugin (for Android Studio and IntelliJ)
139+
com_crashlytics_export_strings.xml
140+
crashlytics.properties
141+
crashlytics-build.properties
142+
fabric.properties
143+
144+
# Editor-based Rest Client
145+
.idea/httpRequests
146+
147+
# Android studio 3.1+ serialized cache file
148+
.idea/caches/build_file_checksums.ser
149+
150+
### Intellij+all Patch ###
151+
# Ignores the whole .idea folder and all .iml files
152+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
153+
2154
.idea/
155+
156+
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
157+
3158
*.iml
159+
modules.xml
160+
.idea/misc.xml
161+
*.ipr
162+
163+
# Sonarlint plugin
164+
.idea/sonarlint
165+
166+
### Java ###
167+
# Compiled class file
168+
*.class
169+
170+
# Log file
171+
*.log
172+
173+
# BlueJ files
174+
*.ctxt
175+
176+
# Mobile Tools for Java (J2ME)
177+
.mtj.tmp/
178+
179+
# Package Files #
180+
*.jar
181+
*.war
182+
*.nar
183+
*.ear
184+
*.zip
185+
*.tar.gz
186+
*.rar
187+
188+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
189+
hs_err_pid*
190+
191+
### Maven ###
192+
target/
4193
pom.xml.tag
5194
pom.xml.releaseBackup
6195
pom.xml.versionsBackup
@@ -9,3 +198,7 @@ release.properties
9198
dependency-reduced-pom.xml
10199
buildNumber.properties
11200
.mvn/timing.properties
201+
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
202+
.mvn/wrapper/maven-wrapper.jar
203+
204+
# End of https://www.toptal.com/developers/gitignore/api/java,maven,eclipse,intellij+all,code-java

pom.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
<properties>
5050
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5151
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
52-
<com.fasterxml.jackson.version>2.10.2</com.fasterxml.jackson.version>
53-
<junit.version>4.12</junit.version>
54-
<org.mockito.version>2.2.28</org.mockito.version>
55-
<org.slf4j.version>1.7.21</org.slf4j.version>
52+
<com.fasterxml.jackson.version>2.11.3</com.fasterxml.jackson.version>
53+
<junit.version>5.7.0</junit.version>
54+
<org.mockito.version>3.6.28</org.mockito.version>
55+
<org.slf4j.version>1.7.30</org.slf4j.version>
5656
</properties>
5757

5858
<dependencies>
@@ -67,9 +67,15 @@
6767
<version>${org.slf4j.version}</version>
6868
</dependency>
6969

70+
<dependency>
71+
<groupId>org.junit.jupiter</groupId>
72+
<artifactId>junit-jupiter-api</artifactId>
73+
<version>${junit.version}</version>
74+
<scope>test</scope>
75+
</dependency>
7076
<dependency>
71-
<groupId>junit</groupId>
72-
<artifactId>junit</artifactId>
77+
<groupId>org.junit.jupiter</groupId>
78+
<artifactId>junit-jupiter-engine</artifactId>
7379
<version>${junit.version}</version>
7480
<scope>test</scope>
7581
</dependency>

src/test/java/io/openapitoools/jackson/dataformat/hal/deser/CurieMapTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package io.openapitoools.jackson.dataformat.hal.deser;
22

3-
import io.openapitools.jackson.dataformat.hal.deser.CurieMap;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
45
import java.net.URI;
5-
import org.junit.Test;
66

7-
import static org.junit.Assert.assertEquals;
7+
import org.junit.jupiter.api.Test;
8+
9+
import io.openapitools.jackson.dataformat.hal.deser.CurieMap;
810

911
public class CurieMapTest {
1012

src/test/java/io/openapitoools/jackson/dataformat/hal/deser/HALBeanDeserializerIT.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
package io.openapitoools.jackson.dataformat.hal.deser;
22

3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertTrue;
5+
6+
import java.io.StringReader;
7+
import java.util.Collection;
8+
9+
import org.junit.jupiter.api.Test;
10+
311
import com.fasterxml.jackson.databind.ObjectMapper;
12+
413
import io.openapitools.jackson.dataformat.hal.HALLink;
514
import io.openapitools.jackson.dataformat.hal.HALMapper;
615
import io.openapitools.jackson.dataformat.hal.annotation.EmbeddedResource;
716
import io.openapitools.jackson.dataformat.hal.annotation.Link;
817
import io.openapitools.jackson.dataformat.hal.annotation.Resource;
9-
import java.io.StringReader;
10-
import java.util.Collection;
11-
import org.junit.Test;
1218

13-
import static org.junit.Assert.assertEquals;
14-
import static org.junit.Assert.assertTrue;
1519

1620
public class HALBeanDeserializerIT {
1721
static final String HAL_DOC = "{"
@@ -51,7 +55,7 @@ public void testDetailedDeserialization() throws Exception {
5155
assertEquals("/uri/{id}", tr.templated.getHref());
5256
assertTrue(tr.templated.getTemplated());
5357
assertEquals("top-title", tr.templated.getTitle());
54-
assertEquals("2017-08-10Z22:00:00", tr.templated.getSeen());
58+
assertEquals("2017-08-10Z22:00:00", tr.templated.getSeen());
5559
assertEquals(2, tr.childLinks.size());
5660
assertEquals(2, tr.children.size());
5761
System.out.println("tr: " + tr);
@@ -95,5 +99,5 @@ public static class ChildResource {
9599
@Link
96100
public HALLink self;
97101
}
98-
102+
99103
}

0 commit comments

Comments
 (0)