Compare commits
2 Commits
26683c0d75
...
5ba9e6af3c
Author | SHA1 | Date |
---|---|---|
honeymoose | 5ba9e6af3c | |
YuCheng Hu | 7a03fd8529 |
|
@ -34,6 +34,7 @@
|
|||
<module name="core-java-io" />
|
||||
<module name="discourse" />
|
||||
<module name="image-processing" />
|
||||
<module name="jackson-jr" />
|
||||
<module name="spring-data-redis" />
|
||||
<module name="core-java" />
|
||||
<module name="jackson-custom-conversions" />
|
||||
|
|
|
@ -51,6 +51,11 @@
|
|||
<option name="name" value="iSharkFly Private Snapshots" />
|
||||
<option name="url" value="https://repo.isharkfly.com/repository/maven-snapshots/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="" />
|
||||
<option name="name" value="" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="ossez-repo-snapshots" />
|
||||
<option name="name" value="OSSEZ Private Snapshots" />
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>jackson-jr</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>jackson-jr</name>
|
||||
|
||||
<parent>
|
||||
|
@ -44,7 +43,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<jackson.version>2.16.0</jackson.version>
|
||||
<jackson.version>2.17.0</jackson.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.jacksonjr;
|
||||
package com.ossez.jacksonjr;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.jacksonjr;
|
||||
package com.ossez.jacksonjr;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.jacksonjr;
|
||||
package com.ossez.jacksonjr;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.jacksonjr;
|
||||
package com.ossez.jacksonjr;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.jacksonjr;
|
||||
package com.ossez.jacksonjr;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ossez.jacksonjr;
|
||||
|
||||
import com.fasterxml.jackson.jr.ob.JSON;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestInstance;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* Create JSON String
|
||||
*/
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
public class CreateJSONTest {
|
||||
|
||||
@Test
|
||||
public void createJsonStringTest() throws IOException {
|
||||
System.out.println(JSON.std.with(JSON.Feature.PRETTY_PRINT_OUTPUT)
|
||||
.asString(new LinkedHashMap<String, Object>() {{
|
||||
put("name", "John Doe");
|
||||
put("age", 30);
|
||||
}}));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.baeldung.jacksonjr;
|
||||
package com.ossez.jacksonjr;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
@ -13,7 +13,7 @@ public class JacksonJrFeaturesUnitTest {
|
|||
|
||||
@Test
|
||||
public void whenSerializingObject_thenReturnJson() throws IOException {
|
||||
String json = JacksonJrFeatures.jsonObject();
|
||||
String json = com.ossez.jacksonjr.JacksonJrFeatures.jsonObject();
|
||||
assertTrue(json.contains("name"));
|
||||
assertTrue(json.contains("age"));
|
||||
}
|
|
@ -45,18 +45,11 @@
|
|||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>${junit-jupiter.version}</version>
|
||||
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
<version>${junit-jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<junit-jupiter.version>5.6.2</junit-jupiter.version>
|
||||
<junit-jupiter.version>5.10.2</junit-jupiter.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
Loading…
Reference in New Issue