/**
 * Waffle (https://github.com/dblock/waffle)
 *
 * Copyright (c) 2010 - 2014 Application Security, Inc.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Application Security, Inc.
 */
package waffle.servlet;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.Test;

import waffle.windows.auth.IWindowsAccount;
import waffle.windows.auth.IWindowsIdentity;

/**
 * @author Tony BenBrahim <tony.benbrahim@airliquide.com>
 *
 */
public class WindowsPrincipalTest {

	private static final String TEST_FQN = "ACME\\john.smith";

	@Test
	public void testToString() {
		final IWindowsIdentity windowsIdentity = mock(IWindowsIdentity.class);
		when(windowsIdentity.getFqn()).thenReturn(TEST_FQN);
		when(windowsIdentity.getGroups()).thenReturn(new IWindowsAccount[0]);
		final WindowsPrincipal principal = new WindowsPrincipal(windowsIdentity);
		assertEquals(TEST_FQN, principal.getName());
		assertEquals(TEST_FQN, principal.toString());
	}

}

@@ -707,9 +707,12 @@
 him 
-%3C
+&lt;
 tony
@@ -740,12 +740,16 @@
 .com
-%3E
+&gt;
 %0A *
+ 
 %0A */
@@ -786,17 +786,20 @@
 Test %7B%0A%0A
-%09
+    
 private 
@@ -854,16 +854,22 @@
 %22;%0A%0A
-%09
+    
 @Test%0A
-%09
+    
 publ
@@ -893,18 +893,24 @@
 ing() %7B%0A
-%09%09
+        
 final IW
@@ -972,18 +972,24 @@
 class);%0A
-%09%09
+        
 when(win
@@ -1033,18 +1033,24 @@
 T_FQN);%0A
-%09%09
+        
 when(win
@@ -1111,18 +1111,24 @@
 nt%5B0%5D);%0A
-%09%09
+        
 final Wi
@@ -1193,18 +1193,24 @@
 ntity);%0A
-%09%09
+        
 assertEq
@@ -1250,10 +1250,16 @@
 ));%0A
-%09%09
+        
 asse
@@ -1304,9 +1304,12 @@
 ));%0A
-%09
+    
 %7D%0A%0A%7D

Format Enforced & JDK8 proper Javadoc