1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.beans.factory.parsing;
18
19 import org.junit.Test;
20
21 import static org.junit.Assert.*;
22
23
24
25
26
27
28
29 public final class PassThroughSourceExtractorTests {
30
31 @Test
32 public void testPassThroughContract() throws Exception {
33 Object source = new Object();
34 Object extractedSource = new PassThroughSourceExtractor().extractSource(source, null);
35 assertSame("The contract of PassThroughSourceExtractor states that the supplied " +
36 "source object *must* be returned as-is", source, extractedSource);
37 }
38
39 @Test
40 public void testPassThroughContractEvenWithNull() throws Exception {
41 Object extractedSource = new PassThroughSourceExtractor().extractSource(null, null);
42 assertNull("The contract of PassThroughSourceExtractor states that the supplied " +
43 "source object *must* be returned as-is (even if null)", extractedSource);
44 }
45
46 }