From a170845f54e61aebe9e62556d86a699c08ee3f59 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Thu, 4 Jul 2024 10:12:43 +0200 Subject: [PATCH] cosmetic: eliminate some code warnings --- .../media/impl/MediaHandlerImplAdobeStandardNamingTest.java | 2 +- .../java/io/wcm/handler/media/impl/MediaHandlerImplTest.java | 2 +- .../wcm/handler/media/impl/ipeconfig/CroppingRatiosTest.java | 3 ++- .../io/wcm/handler/media/testcontext/DummyAppTemplate.java | 5 ----- .../handler/media/testcontext/DummyMediaHandlerConfig.java | 1 + .../impl/AssertThumbnailWebRenditionMediaHandlerTest.java | 1 + .../mediasource/ngdm/impl/metadata/MetadataSample.java | 3 +++ 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplAdobeStandardNamingTest.java b/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplAdobeStandardNamingTest.java index 55d4b010..93831280 100644 --- a/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplAdobeStandardNamingTest.java +++ b/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplAdobeStandardNamingTest.java @@ -94,6 +94,6 @@ public boolean useAdobeStandardNames() { // switch to adobe standard naming return true; } - }; + } } diff --git a/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplTest.java b/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplTest.java index c307f482..d4a45286 100644 --- a/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplTest.java +++ b/src/test/java/io/wcm/handler/media/impl/MediaHandlerImplTest.java @@ -326,7 +326,7 @@ public List> getPostProcessors() { return List.of(TestPostProcessor.class); } - }; + } @Model(adaptables = { diff --git a/src/test/java/io/wcm/handler/media/impl/ipeconfig/CroppingRatiosTest.java b/src/test/java/io/wcm/handler/media/impl/ipeconfig/CroppingRatiosTest.java index 6440050d..7bb32696 100644 --- a/src/test/java/io/wcm/handler/media/impl/ipeconfig/CroppingRatiosTest.java +++ b/src/test/java/io/wcm/handler/media/impl/ipeconfig/CroppingRatiosTest.java @@ -31,6 +31,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; +import org.mockito.Mock.Strictness; import org.mockito.junit.jupiter.MockitoExtension; import io.wcm.handler.media.MediaArgs; @@ -42,7 +43,7 @@ @ExtendWith(MockitoExtension.class) class CroppingRatiosTest { - @Mock(lenient = true) + @Mock(strictness = Strictness.LENIENT) private MediaFormatHandler mediaFormatHandler; private SortedSet mediaFormats = new TreeSet<>(); diff --git a/src/test/java/io/wcm/handler/media/testcontext/DummyAppTemplate.java b/src/test/java/io/wcm/handler/media/testcontext/DummyAppTemplate.java index 034d9cd1..2a371449 100644 --- a/src/test/java/io/wcm/handler/media/testcontext/DummyAppTemplate.java +++ b/src/test/java/io/wcm/handler/media/testcontext/DummyAppTemplate.java @@ -52,11 +52,6 @@ public enum DummyAppTemplate { this.resourceType = resourceTypeFromPath; } - DummyAppTemplate(String templatePath, String resourceType) { - this.templatePath = templatePath; - this.resourceType = resourceType; - } - /** * Template path * @return Path diff --git a/src/test/java/io/wcm/handler/media/testcontext/DummyMediaHandlerConfig.java b/src/test/java/io/wcm/handler/media/testcontext/DummyMediaHandlerConfig.java index e4c08b12..432a0b5f 100644 --- a/src/test/java/io/wcm/handler/media/testcontext/DummyMediaHandlerConfig.java +++ b/src/test/java/io/wcm/handler/media/testcontext/DummyMediaHandlerConfig.java @@ -47,6 +47,7 @@ public class DummyMediaHandlerConfig extends MediaHandlerConfig { } @Override + @Deprecated public boolean includeAssetWebRenditionsByDefault() { // unit tests rely on old behavior return true; diff --git a/src/test/java/io/wcm/handler/mediasource/dam/impl/AssertThumbnailWebRenditionMediaHandlerTest.java b/src/test/java/io/wcm/handler/mediasource/dam/impl/AssertThumbnailWebRenditionMediaHandlerTest.java index f52d8deb..8f5499f3 100644 --- a/src/test/java/io/wcm/handler/mediasource/dam/impl/AssertThumbnailWebRenditionMediaHandlerTest.java +++ b/src/test/java/io/wcm/handler/mediasource/dam/impl/AssertThumbnailWebRenditionMediaHandlerTest.java @@ -144,6 +144,7 @@ void testWithAllowSpecificRenditions() { void testWithDisallowWebRenditionsViaMediaHandlerConfig() { context.registerService(MediaHandlerConfig.class, new MediaHandlerConfig() { @Override + @Deprecated public boolean includeAssetWebRenditionsByDefault() { return false; } diff --git a/src/test/java/io/wcm/handler/mediasource/ngdm/impl/metadata/MetadataSample.java b/src/test/java/io/wcm/handler/mediasource/ngdm/impl/metadata/MetadataSample.java index 54db3a3c..40f291ef 100644 --- a/src/test/java/io/wcm/handler/mediasource/ngdm/impl/metadata/MetadataSample.java +++ b/src/test/java/io/wcm/handler/mediasource/ngdm/impl/metadata/MetadataSample.java @@ -21,11 +21,14 @@ import static io.wcm.handler.mediasource.ngdm.impl.NextGenDynamicMediaReferenceSample.SAMPLE_ASSET_ID; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + /** * Next Gen Dynamic Media Metadata samples. */ public final class MetadataSample { + @SuppressFBWarnings("HSC_HUGE_SHARED_STRING_CONSTANT") public static final String METADATA_JSON_IMAGE = "{" + " \"assetId\": \"" + SAMPLE_ASSET_ID + "\"," + " \"repositoryMetadata\": {"