-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
160 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
import org.apache.tools.ant.filters.ReplaceTokens | ||
|
||
plugins { | ||
id 'org.springframework.boot' version '2.6.12' | ||
id 'io.spring.dependency-management' version '1.0.11.RELEASE' | ||
id 'org.springframework.boot' version '2.7.18' | ||
id 'io.spring.dependency-management' version '1.1.4' | ||
} | ||
|
||
group = 'org.sonatype.cs' | ||
sourceCompatibility = '1.8' | ||
java { | ||
sourceCompatibility = '1.8' | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
|
||
implementation 'com.opencsv:opencsv:5.7.1' | ||
implementation 'commons-io:commons-io:2.11.0' | ||
implementation 'javax.json:javax.json-api:1.0' | ||
implementation 'org.apache.tomcat:tomcat-util:9.0.16' | ||
implementation 'org.glassfish:javax.json:1.1' | ||
|
||
implementation 'org.apache.tomcat:tomcat-coyote:9.0.67' | ||
|
||
implementation 'org.apache.commons:commons-csv:1.5' | ||
implementation 'com.opencsv:opencsv:5.2' | ||
implementation 'org.apache.httpcomponents:httpclient:4.5.13' | ||
implementation 'commons-codec:commons-codec:1.14' | ||
implementation 'commons-io:commons-io:2.11.0' | ||
implementation 'org.json:json:20210307' | ||
implementation 'com.googlecode.json-simple:json-simple:1.1.1' | ||
|
||
implementation 'org.apache.tomcat:tomcat-coyote:9.0.83' | ||
implementation 'org.apache.tomcat:tomcat-util:9.0.82' | ||
implementation 'org.glassfish:javax.json:1.1' | ||
implementation 'org.json:json:20231013' | ||
implementation 'org.springframework.boot:spring-boot-starter' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation "org.mockito:mockito-core:4.3.1" | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
get-metrics/src/test/java/org/sonatype/cs/getmetrics/util/ParseReasonsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.sonatype.cs.getmetrics.util; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.json.Json; | ||
import javax.json.JsonArray; | ||
|
||
public class ParseReasonsTest { | ||
@Test | ||
void testEmptyLicenseString() { | ||
JsonArray reasons = | ||
Json.createArrayBuilder().add(Json.createObjectBuilder().add("reason", "")).build(); | ||
|
||
String actualReason = ParseReasons.getLicense(reasons); | ||
Assertions.assertEquals("", actualReason); | ||
} | ||
|
||
@Test | ||
void testSingleLicenseString() { | ||
JsonArray reasons = | ||
Json.createArrayBuilder() | ||
.add(Json.createObjectBuilder().add("reason", "(license)")) | ||
.build(); | ||
|
||
String actualReason = ParseReasons.getLicense(reasons); | ||
Assertions.assertEquals("license", actualReason); | ||
} | ||
|
||
@Test | ||
void testMultipltLicenseString() { | ||
JsonArray reasons = | ||
Json.createArrayBuilder() | ||
.add(Json.createObjectBuilder().add("reason", "(license)")) | ||
.add(Json.createObjectBuilder().add("reason", "(license2)")) | ||
.build(); | ||
|
||
String actualReason = ParseReasons.getLicense(reasons); | ||
Assertions.assertEquals("license:license2", actualReason); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.