View Javadoc
1   package org.kuali.common.util;
2   
3   import org.junit.Assert;
4   import org.junit.Test;
5   
6   public class StrTest {
7   
8   	@Test
9   	public void testConceal() {
10  		String original = "foo.bar.baz";
11  		String concealed = Str.conceal(original);
12  		String revealed = Str.reveal(concealed);
13  		Assert.assertEquals(original, revealed); // Test that we got our original string back
14  		Assert.assertEquals(concealed, Str.conceal(concealed)); // Attempting to conceal an already concealed string is a NOOP
15  		Assert.assertEquals(revealed, Str.reveal(revealed)); // Attempting to reveal an already revealed string is a NOOP
16  	}
17  
18  	@Test
19  	public void test2() {
20  		String original = "bar.baz";
21  		System.out.println(Str.conceal(original));
22  	}
23  }