From 3c08de9de471013dca47ce965fa1292fac331e7b Mon Sep 17 00:00:00 2001 From: Valentin Delaye Date: Sat, 26 Sep 2026 17:55:18 +0200 Subject: [PATCH] Spotless update and format Signed-off-by: Valentin Delaye --- pom.xml | 2 +- .../oras/GitHubContainerRegistryITCase.java | 5 +- .../java/land/oras/PublicAzureCRITCase.java | 9 ++-- .../java/land/oras/auth/HttpClientTest.java | 46 +++++++++++-------- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index fbe79b39..e0d7fea0 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 3.6.2 0.8.15 - 3.10.2 + 3.10.3 3.16.0 3.5.0 3.2.0 diff --git a/src/test/java/land/oras/GitHubContainerRegistryITCase.java b/src/test/java/land/oras/GitHubContainerRegistryITCase.java index a368e11d..f81e0d52 100644 --- a/src/test/java/land/oras/GitHubContainerRegistryITCase.java +++ b/src/test/java/land/oras/GitHubContainerRegistryITCase.java @@ -72,8 +72,9 @@ void shouldGetReferrersUsingLegacyTagFallback() { Referrers referrers = registry.getReferrers(containerRef, null); assertFalse(referrers.getManifests().isEmpty(), "Referrers must be found through the legacy tag fallback"); assertTrue( - referrers.getManifests().stream().anyMatch(manifest -> "application/vnd.dev.sigstore.bundle.v0.3+json" - .equals(manifest.getArtifactType())), + referrers.getManifests().stream() + .anyMatch(manifest -> + "application/vnd.dev.sigstore.bundle.v0.3+json".equals(manifest.getArtifactType())), "Sigstore bundle referrer must be found"); } diff --git a/src/test/java/land/oras/PublicAzureCRITCase.java b/src/test/java/land/oras/PublicAzureCRITCase.java index 93eaca39..3584d020 100644 --- a/src/test/java/land/oras/PublicAzureCRITCase.java +++ b/src/test/java/land/oras/PublicAzureCRITCase.java @@ -54,10 +54,11 @@ void shouldContainsCommonWindowsPlatform() { containerSource = ContainerRef.parse( "mcr.microsoft.com/windows/servercore@sha256:79aa6a176b2e4f1786eb29c4facd33077769eddde4c4a650aea552f6320893c7"); index = sourceRegistry.getIndex(containerSource); - assertTrue(index.getManifests().stream().anyMatch(m -> m.getPlatform() - .equals(Platform.windowsAmd64() - .withOsVersion("10.0.26100.32370") - .withOsFeatures(List.of("win32k"))))); + assertTrue(index.getManifests().stream() + .anyMatch(m -> m.getPlatform() + .equals(Platform.windowsAmd64() + .withOsVersion("10.0.26100.32370") + .withOsFeatures(List.of("win32k"))))); } @Test diff --git a/src/test/java/land/oras/auth/HttpClientTest.java b/src/test/java/land/oras/auth/HttpClientTest.java index fc09cadf..69c68a94 100644 --- a/src/test/java/land/oras/auth/HttpClientTest.java +++ b/src/test/java/land/oras/auth/HttpClientTest.java @@ -145,9 +145,11 @@ void whenCaFileFromStringThenSucceed(@TempDir Path tempDir) throws IOException { @Test void whenCaFileDoesNotExistThenThrow() { - OrasException exception = assertThrows(OrasException.class, () -> HttpClient.Builder.builder() - .withCaFile(Path.of("/nonexistent/ca.pem")) - .build()); + OrasException exception = assertThrows( + OrasException.class, + () -> HttpClient.Builder.builder() + .withCaFile(Path.of("/nonexistent/ca.pem")) + .build()); assertTrue(exception.getMessage().contains("Unable to configure CA file")); } @@ -186,9 +188,11 @@ void whenCaContentIsEmptyThenThrow() { @Test void whenCaContentNotValidCertificateThenThrow() { - OrasException exception = assertThrows(OrasException.class, () -> HttpClient.Builder.builder() - .withCaContent("not a certificate") - .build()); + OrasException exception = assertThrows( + OrasException.class, + () -> HttpClient.Builder.builder() + .withCaContent("not a certificate") + .build()); assertTrue(exception.getMessage().contains("Unable to configure CA certificates from content")); } @@ -196,10 +200,12 @@ void whenCaContentNotValidCertificateThenThrow() { void whenBothCaFileAndCaContentConfiguredThenThrow(@TempDir Path tempDir) throws IOException { Path caFile = tempDir.resolve("ca.pem"); Files.writeString(caFile, ROOT_CA_PEM); - OrasException exception = assertThrows(OrasException.class, () -> HttpClient.Builder.builder() - .withCaFile(caFile) - .withCaContent(ROOT_CA_PEM) - .build()); + OrasException exception = assertThrows( + OrasException.class, + () -> HttpClient.Builder.builder() + .withCaFile(caFile) + .withCaContent(ROOT_CA_PEM) + .build()); assertTrue(exception.getMessage().contains("Cannot configure both a CA file and CA content")); } @@ -207,19 +213,23 @@ void whenBothCaFileAndCaContentConfiguredThenThrow(@TempDir Path tempDir) throws void whenSkipTlsVerifyAndCaFileThenThrow(@TempDir Path tempDir) throws IOException { Path caFile = tempDir.resolve("ca.pem"); Files.writeString(caFile, ROOT_CA_PEM); - OrasException exception = assertThrows(OrasException.class, () -> HttpClient.Builder.builder() - .withSkipTlsVerify(true) - .withCaFile(caFile) - .build()); + OrasException exception = assertThrows( + OrasException.class, + () -> HttpClient.Builder.builder() + .withSkipTlsVerify(true) + .withCaFile(caFile) + .build()); assertTrue(exception.getMessage().contains("Cannot combine skipTlsVerify")); } @Test void whenSkipTlsVerifyAndCaContentThenThrow() { - OrasException exception = assertThrows(OrasException.class, () -> HttpClient.Builder.builder() - .withSkipTlsVerify(true) - .withCaContent(ROOT_CA_PEM) - .build()); + OrasException exception = assertThrows( + OrasException.class, + () -> HttpClient.Builder.builder() + .withSkipTlsVerify(true) + .withCaContent(ROOT_CA_PEM) + .build()); assertTrue(exception.getMessage().contains("Cannot combine skipTlsVerify")); }