1 /*
2 * SPDX-FileCopyrightText: Copyright (c) 2011-2026 Yegor Bugayenko
3 * SPDX-License-Identifier: MIT
4 */
5 package com.qulice.pmd;
6
7 import org.hamcrest.Matchers;
8 import org.junit.jupiter.api.Test;
9
10 /**
11 * Test case for {@link PmdValidator}'s tolerance of duplicate
12 * string literals when they appear inside annotations (the
13 * {@code AvoidDuplicateLiterals} rule is relaxed there).
14 * @since 0.25.1
15 */
16 final class PmdDuplicateLiteralsTest {
17
18 @Test
19 void allowsDuplicateLiteralsInAnnotations() throws Exception {
20 new PmdAssert(
21 "AllowsDuplicateLiteralsInAnnotations.java",
22 Matchers.is(true),
23 Matchers.not(
24 Matchers.containsString("AvoidDuplicateLiterals")
25 )
26 ).assertOk();
27 }
28 }