1
2
3
4
5 package com.qulice.pmd;
6
7 import org.hamcrest.Matchers;
8 import org.junit.jupiter.api.Test;
9
10
11
12
13
14
15
16 final class PmdCloneMethodTest {
17
18 @Test
19 void forbidsNonPublicCloneMethod() throws Exception {
20 new PmdAssert(
21 "CloneMethodMustBePublic.java",
22 Matchers.is(false),
23 Matchers.containsString("(CloneMethodMustBePublic)")
24 ).assertOk();
25 }
26
27 @Test
28 void forbidsCloneMethodReturnTypeNotMatchingClassName() throws Exception {
29 new PmdAssert(
30 "CloneMethodReturnTypeMustMatchClassName.java",
31 Matchers.is(false),
32 Matchers.containsString("(CloneMethodReturnTypeMustMatchClassName)")
33 ).assertOk();
34 }
35 }