1 package org.apache.maven.plugins.shade.relocation;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.junit.Test;
23
24 import java.util.Collections;
25
26 import static org.junit.Assert.fail;
27
28 public class SimpleRelocatorParameterTest
29 {
30
31 @Test
32 public void testThatNullPatternInConstructorShouldNotThrowNullPointerException()
33 {
34 constructThenFailOnNullPointerException( null, "" );
35 }
36
37 @Test
38 public void testThatNullShadedPatternInConstructorShouldNotThrowNullPointerException()
39 {
40 constructThenFailOnNullPointerException( "", null );
41 }
42
43 private void constructThenFailOnNullPointerException( String pattern, String shadedPattern )
44 {
45 try
46 {
47 new SimpleRelocator( pattern, shadedPattern, Collections.<String> emptyList(), Collections.<String> emptyList() );
48 }
49 catch ( NullPointerException e )
50 {
51 fail( "Constructor should not throw null pointer exceptions" );
52 }
53 }
54 }