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
17 final class PmdCloneMethodTest {
18
19 @Test
20 void forbidsNonPublicCloneMethod() throws Exception {
21 new PmdAssert(
22 "CloneMethodMustBePublic.java",
23 Matchers.is(false),
24 Matchers.containsString("(CloneMethodMustBePublic)")
25 ).assertOk();
26 }
27
28 @Test
29 void forbidsCloneMethodReturnTypeNotMatchingClassName() throws Exception {
30 new PmdAssert(
31 "CloneMethodReturnTypeMustMatchClassName.java",
32 Matchers.is(false),
33 Matchers.containsString("(CloneMethodReturnTypeMustMatchClassName)")
34 ).assertOk();
35 }
36 }