Skip to content

Commit 11ce5da

Browse files
committed
Merge branch 'release/0.3.0'
Fixed: #5
2 parents b829ab8 + 2c244c2 commit 11ce5da

File tree

9 files changed

+7082
-9
lines changed

9 files changed

+7082
-9
lines changed

net.adoptopenjdk.v3.api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>net.adoptopenjdk</artifactId>
1111
<groupId>net.adoptopenjdk</groupId>
12-
<version>0.2.0</version>
12+
<version>0.3.0</version>
1313
</parent>
1414

1515
<artifactId>net.adoptopenjdk.v3.api</artifactId>

net.adoptopenjdk.v3.api/src/main/java/net/adoptopenjdk/v3/api/AOV3InstallerType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface AOV3InstallerType
3333
* @return The checksum of the data
3434
*/
3535

36-
String checksum();
36+
Optional<String> checksum();
3737

3838
/**
3939
* @return A link to the checksum of the data

net.adoptopenjdk.v3.tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>net.adoptopenjdk</artifactId>
1111
<groupId>net.adoptopenjdk</groupId>
12-
<version>0.2.0</version>
12+
<version>0.3.0</version>
1313
</parent>
1414

1515
<artifactId>net.adoptopenjdk.v3.tests</artifactId>

net.adoptopenjdk.v3.tests/src/test/java/net/adoptopenjdk/v3/tests/AOV3ResponseParsersTest.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import net.adoptopenjdk.v3.api.AOV3Error;
1818
import net.adoptopenjdk.v3.api.AOV3ExceptionParseFailed;
19+
import net.adoptopenjdk.v3.api.AOV3Installer;
1920
import net.adoptopenjdk.v3.vanilla.AOV3ResponseParsers;
2021
import net.adoptopenjdk.v3.vanilla.AOV3ResponseParsersType;
2122
import org.apache.commons.io.input.BrokenInputStream;
@@ -274,6 +275,37 @@ public void testAssetsForLatest()
274275
Assertions.assertEquals(0, this.errors.size());
275276
}
276277

278+
@Test
279+
public void testAssetsForReleases8()
280+
throws Exception
281+
{
282+
final var stream = resource("releases8.json");
283+
final var parser =
284+
this.parsers.createParser(this::logError, URI.create("urn:test"), stream);
285+
final var releases = parser.parseAssetsForRelease();
286+
287+
for (final var release : releases) {
288+
LOG.debug("release {}", release.id());
289+
for (final var binary : release.binaries()) {
290+
LOG.debug("release {} binary {}", release.id(), binary.package_().name());
291+
final var packChecksumOpt = binary.package_().checksum();
292+
if (packChecksumOpt.isPresent()) {
293+
final var checksum = packChecksumOpt.get();
294+
Assertions.assertFalse(checksum.isBlank());
295+
}
296+
297+
final var instChecksumOpt =
298+
binary.installer().flatMap(AOV3Installer::checksum);
299+
if (instChecksumOpt.isPresent()) {
300+
final var checksum = instChecksumOpt.get();
301+
Assertions.assertFalse(checksum.isBlank());
302+
}
303+
}
304+
}
305+
306+
Assertions.assertEquals(0, this.errors.size());
307+
}
308+
277309
private void testAssetsForReleaseFuzzOnce(
278310
final Integer index)
279311
throws Exception

net.adoptopenjdk.v3.tests/src/test/resources/net/adoptopenjdk/v3/tests/releases8.json

Lines changed: 7041 additions & 0 deletions
Large diffs are not rendered by default.

net.adoptopenjdk.v3.vanilla/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>net.adoptopenjdk</artifactId>
1111
<groupId>net.adoptopenjdk</groupId>
12-
<version>0.2.0</version>
12+
<version>0.3.0</version>
1313
</parent>
1414

1515
<artifactId>net.adoptopenjdk.v3.vanilla</artifactId>

net.adoptopenjdk.v3.vanilla/src/main/java/net/adoptopenjdk/v3/vanilla/AOV3AST.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static final class AOV3ReleaseVersionsJSON implements AOV3ASTMemberType
115115
public static final class AOV3InstallerJSON implements AOV3ASTMemberType
116116
{
117117
@JsonProperty(value = "checksum", required = true)
118-
String checksum = "";
118+
String checksum;
119119

120120
@JsonProperty(value = "checksum_link", required = true)
121121
URI checksumLink;
@@ -140,7 +140,7 @@ public static final class AOV3InstallerJSON implements AOV3ASTMemberType
140140
public static final class AOV3PackageJSON implements AOV3ASTMemberType
141141
{
142142
@JsonProperty(value = "checksum", required = true)
143-
String checksum = "";
143+
String checksum;
144144

145145
@JsonProperty(value = "checksum_link", required = true)
146146
URI checksumLink;

net.adoptopenjdk.v3.vanilla/src/main/java/net/adoptopenjdk/v3/vanilla/AOV3ResponseParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private static AOV3Installer toInstaller(
137137
final AOV3AST.AOV3InstallerJSON installer)
138138
{
139139
final var checksum =
140-
Objects.requireNonNull(installer.checksum, "installer.checksum");
140+
Optional.ofNullable(installer.checksum);
141141
final var checksumLink =
142142
Optional.ofNullable(installer.checksumLink);
143143
final var downloadCount =
@@ -168,7 +168,7 @@ private static AOV3Package toPackage(
168168
final AOV3AST.AOV3PackageJSON package_)
169169
{
170170
final var checksum =
171-
Objects.requireNonNull(package_.checksum, "package_.checksum");
171+
Optional.ofNullable(package_.checksum);
172172
final var checksumLink =
173173
Optional.ofNullable(package_.checksumLink);
174174
final var downloadCount =

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<groupId>net.adoptopenjdk</groupId>
1616
<artifactId>net.adoptopenjdk</artifactId>
17-
<version>0.2.0</version>
17+
<version>0.3.0</version>
1818
<packaging>pom</packaging>
1919

2020
<name>net.adoptopenjdk</name>

0 commit comments

Comments
 (0)