Skip to content

Commit 3583073

Browse files
Added first commit
1 parent 634658d commit 3583073

16 files changed

Lines changed: 1097 additions & 0 deletions

File tree

.classpath

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
</attributes>
29+
</classpathentry>
30+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
31+
<attributes>
32+
<attribute name="maven.pomderived" value="true"/>
33+
</attributes>
34+
</classpathentry>
35+
<classpathentry kind="output" path="target/classes"/>
36+
</classpath>

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target/
2+
/.project
3+
/Report/

.settings/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/org.eclipse.jdt.core.prefs
2+
/org.eclipse.m2e.core.prefs

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# json-diff-report
2+
Command line API call compare JSON and provide great json comparison report
3+
4+
## What it does?
5+
This utility built on JAVA, it's a command line based tool to execute API calls and do comparison
6+
7+
## Setup
8+
1. Download latest release from https://github.com/next-time-space/json-diff-report/releases
9+
2. Extract to a directory
10+
3. Edit file input.json with all the API information
11+
4. Execute the utiliy using java -jar json-diff-report.jar
12+
5. Report will be created in the folder called "Report"

app.conf

Whitespace-only changes.

input.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"inputs": [
3+
{
4+
"urlSource": "https://api.stackexchange.com/2.2/questions/51227849?order=desc&sort=activity&site=stackoverflow",
5+
"urlCompare": "https://api.stackexchange.com/2.2/questions/28668452?order=desc&sort=activity&site=stackoverflow",
6+
"method": null,
7+
"headersSource": {
8+
"accept": "application/json"
9+
},
10+
"headersCompare": {
11+
"accept": "application/json"
12+
},
13+
"requestSource": null,
14+
"requestCompare": null
15+
},
16+
{
17+
"urlSource": "https://api3.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=today",
18+
"urlCompare": "https://api3.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2018-09-10",
19+
"method": null,
20+
"headersSource": {
21+
"accept": "application/json"
22+
},
23+
"headersCompare": {
24+
"accept": "application/json"
25+
},
26+
"requestSource": null,
27+
"requestCompare": null
28+
},
29+
{
30+
"urlSource": "https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=today",
31+
"urlCompare": "https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2018-09-10",
32+
"method": null,
33+
"headersSource": {
34+
"accept": "application/json"
35+
},
36+
"headersCompare": {
37+
"accept": "application/json"
38+
},
39+
"requestSource": null,
40+
"requestCompare": null
41+
},
42+
{
43+
"urlSource": "http://api.oceandrivers.com/static/resources.json",
44+
"urlCompare": "http://api.oceandrivers.com/static/resources.json",
45+
"method": null,
46+
"headersSource": {
47+
"accept": "application/json"
48+
},
49+
"headersCompare": {
50+
"accept": "application/json"
51+
},
52+
"requestSource": null,
53+
"requestCompare": null
54+
}
55+
]
56+
}

pom.xml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.nexttimespace.utilities</groupId>
6+
<artifactId>json-diff-report</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<description>Provides JSON differences in HTML format</description>
9+
10+
<build>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.apache.maven.plugins</groupId>
14+
<artifactId>maven-assembly-plugin</artifactId>
15+
<version>3.1.0</version>
16+
<configuration>
17+
<descriptorRefs>
18+
<descriptorRef>jar-with-dependencies</descriptorRef>
19+
</descriptorRefs>
20+
<archive>
21+
<manifest>
22+
<mainClass>com.nexttimespace.utilities.diffbox.Executor</mainClass>
23+
</manifest>
24+
</archive>
25+
26+
</configuration>
27+
<executions>
28+
<execution>
29+
<id>make-assembly</id>
30+
<phase>package</phase>
31+
<goals>
32+
<goal>single</goal>
33+
</goals>
34+
</execution>
35+
</executions>
36+
</plugin>
37+
38+
</plugins>
39+
</build>
40+
<properties>
41+
<maven.compiler.source>1.8</maven.compiler.source>
42+
<maven.compiler.target>1.8</maven.compiler.target>
43+
<maven.test.skip>true</maven.test.skip>
44+
</properties>
45+
<dependencies>
46+
<dependency>
47+
<groupId>com.google.guava</groupId>
48+
<artifactId>guava</artifactId>
49+
<version>26.0-jre</version>
50+
</dependency>
51+
<dependency>
52+
<groupId>com.google.code.gson</groupId>
53+
<artifactId>gson</artifactId>
54+
<version>2.8.5</version>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.json</groupId>
58+
<artifactId>json</artifactId>
59+
<version>20090211</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.apache.commons</groupId>
63+
<artifactId>commons-lang3</artifactId>
64+
<version>3.8</version>
65+
</dependency>
66+
67+
<dependency>
68+
<groupId>commons-io</groupId>
69+
<artifactId>commons-io</artifactId>
70+
<version>2.5</version>
71+
</dependency>
72+
<dependency>
73+
<groupId>com.github.spullara.mustache.java</groupId>
74+
<artifactId>compiler</artifactId>
75+
<version>0.9.5</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.springframework</groupId>
79+
<artifactId>spring-web</artifactId>
80+
<version>5.0.8.RELEASE</version>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.apache.httpcomponents</groupId>
84+
<artifactId>httpclient</artifactId>
85+
<version>4.5.6</version>
86+
</dependency>
87+
<dependency>
88+
<groupId>com.fasterxml.jackson.core</groupId>
89+
<artifactId>jackson-databind</artifactId>
90+
<version>2.9.5</version>
91+
</dependency>
92+
</dependencies>
93+
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.nexttimespace.utilities.diffbox;
2+
3+
import java.io.Serializable;
4+
5+
public class DiffResponse implements Serializable{
6+
private static final long serialVersionUID = 3451985135067844197L;
7+
private String sourceTag;
8+
private String compareWithTag;
9+
private String sourceValue;
10+
private String compareWithValue;
11+
private boolean status;
12+
public String getSourceTag() {
13+
return sourceTag;
14+
}
15+
public void setSourceTag(String sourceTag) {
16+
this.sourceTag = sourceTag;
17+
}
18+
public String getCompareWithTag() {
19+
return compareWithTag;
20+
}
21+
public void setCompareWithTag(String compareWithTag) {
22+
this.compareWithTag = compareWithTag;
23+
}
24+
public String getSourceValue() {
25+
return sourceValue;
26+
}
27+
public void setSourceValue(String sourceValue) {
28+
this.sourceValue = sourceValue;
29+
}
30+
public String getCompareWithValue() {
31+
return compareWithValue;
32+
}
33+
public void setCompareWithValue(String compareWithValue) {
34+
this.compareWithValue = compareWithValue;
35+
}
36+
public boolean isStatus() {
37+
return status;
38+
}
39+
public void setStatus(boolean status) {
40+
this.status = status;
41+
}
42+
}

0 commit comments

Comments
 (0)