Compare commits

...

2 Commits

11 changed files with 40 additions and 17 deletions

View File

@ -34,6 +34,7 @@
<module name="core-java-io" /> <module name="core-java-io" />
<module name="discourse" /> <module name="discourse" />
<module name="image-processing" /> <module name="image-processing" />
<module name="jackson-jr" />
<module name="spring-data-redis" /> <module name="spring-data-redis" />
<module name="core-java" /> <module name="core-java" />
<module name="jackson-custom-conversions" /> <module name="jackson-custom-conversions" />

View File

@ -51,6 +51,11 @@
<option name="name" value="iSharkFly Private Snapshots" /> <option name="name" value="iSharkFly Private Snapshots" />
<option name="url" value="https://repo.isharkfly.com/repository/maven-snapshots/" /> <option name="url" value="https://repo.isharkfly.com/repository/maven-snapshots/" />
</remote-repository> </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> <remote-repository>
<option name="id" value="ossez-repo-snapshots" /> <option name="id" value="ossez-repo-snapshots" />
<option name="name" value="OSSEZ Private Snapshots" /> <option name="name" value="OSSEZ Private Snapshots" />

View File

@ -4,7 +4,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <modelVersion>4.0.0</modelVersion>
<artifactId>jackson-jr</artifactId> <artifactId>jackson-jr</artifactId>
<packaging>pom</packaging>
<name>jackson-jr</name> <name>jackson-jr</name>
<parent> <parent>
@ -44,7 +43,7 @@
</build> </build>
<properties> <properties>
<jackson.version>2.16.0</jackson.version> <jackson.version>2.17.0</jackson.version>
</properties> </properties>
</project> </project>

View File

@ -1,4 +1,4 @@
package com.baeldung.jacksonjr; package com.ossez.jacksonjr;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package com.baeldung.jacksonjr; package com.ossez.jacksonjr;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package com.baeldung.jacksonjr; package com.ossez.jacksonjr;
import java.io.IOException; import java.io.IOException;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;

View File

@ -1,4 +1,4 @@
package com.baeldung.jacksonjr; package com.ossez.jacksonjr;
import java.time.LocalDate; import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package com.baeldung.jacksonjr; package com.ossez.jacksonjr;
import java.time.LocalDate; import java.time.LocalDate;

View File

@ -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);
}}));
}
}

View File

@ -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.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertFalse;
@ -13,7 +13,7 @@ public class JacksonJrFeaturesUnitTest {
@Test @Test
public void whenSerializingObject_thenReturnJson() throws IOException { public void whenSerializingObject_thenReturnJson() throws IOException {
String json = JacksonJrFeatures.jsonObject(); String json = com.ossez.jacksonjr.JacksonJrFeatures.jsonObject();
assertTrue(json.contains("name")); assertTrue(json.contains("name"));
assertTrue(json.contains("age")); assertTrue(json.contains("age"));
} }

View File

@ -45,18 +45,11 @@
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId> <artifactId>junit-jupiter</artifactId>
<version>${junit-jupiter.version}</version> <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> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<junit-jupiter.version>5.6.2</junit-jupiter.version> <junit-jupiter.version>5.10.2</junit-jupiter.version>
</properties> </properties>
</project> </project>