1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.rat.document;
20
21 import static org.junit.jupiter.api.Assertions.assertEquals;
22 import static org.junit.jupiter.api.Assertions.assertNotNull;
23 import static org.junit.jupiter.api.Assertions.assertNull;
24
25 import org.apache.rat.testhelpers.TestingLocation;
26 import org.junit.jupiter.api.Test;
27
28 public class ToNameTransformerTest {
29
30 private final ToNameTransformer transformer = new ToNameTransformer();
31
32 @Test
33 public void transformLocation() {
34 TestingLocation location = new TestingLocation();
35 Object result = transformer.transform(location);
36 assertNotNull(result, "Transform into name");
37 assertEquals(location.name, result, "Transform into name");
38 }
39
40 @Test
41 public void transformNull() {
42 Object result = transformer.transform(null);
43 assertNull(result, "Null transforms to null");
44 }
45 }