88import static org .hamcrest .CoreMatchers .*;
99
1010/**
11- * Tests for Jackson implementation selection via {@link GitHubBuilder#useJackson3 ()}.
11+ * Tests for Jackson implementation selection via {@link GitHubBuilder#useJackson2 ()}.
1212 */
1313public class GitHubJacksonTest extends AbstractGitHubWireMockTest {
1414
@@ -20,30 +20,32 @@ public GitHubJacksonTest() {
2020 }
2121
2222 /**
23- * Test that the default Jackson implementation is Jackson 2 .
23+ * Test that the default Jackson implementation is Jackson 3 when available .
2424 *
2525 * @throws IOException
2626 * the io exception
2727 */
2828 @ Test
29- public void testDefaultJacksonIsJackson2 () throws IOException {
29+ public void testDefaultJacksonIsJackson3WhenAvailable () throws IOException {
3030 gitHub = getGitHubBuilder ().build ();
3131 String implementationName = gitHub .getClient ().getJacksonImplementationName ();
32- assertThat (implementationName , startsWith ("Jackson 2." ));
32+ if (DefaultGitHubJackson .isJackson3Available ()) {
33+ assertThat (implementationName , startsWith ("Jackson 3." ));
34+ } else {
35+ assertThat (implementationName , startsWith ("Jackson 2." ));
36+ }
3337 }
3438
3539 /**
36- * Test that Jackson 3 can be configured via builder when available .
40+ * Test that Jackson 2 can be explicitly configured via builder.
3741 *
3842 * @throws IOException
3943 * the io exception
4044 */
4145 @ Test
42- public void testJackson3ViaBuilder () throws IOException {
43- if (DefaultGitHubJackson .isJackson3Available ()) {
44- gitHub = getGitHubBuilder ().useJackson3 ().build ();
45- String implementationName = gitHub .getClient ().getJacksonImplementationName ();
46- assertThat (implementationName , startsWith ("Jackson 3." ));
47- }
46+ public void testJackson2ViaBuilder () throws IOException {
47+ gitHub = getGitHubBuilder ().useJackson2 ().build ();
48+ String implementationName = gitHub .getClient ().getJacksonImplementationName ();
49+ assertThat (implementationName , startsWith ("Jackson 2." ));
4850 }
4951}
0 commit comments