package am.control;

import org.junit.Test;
import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.ui.ModelMap;

import static org.junit.Assert.*;

public class MappingsControllerTest {

  private MappingsController subject = new MappingsController();

  @Test
  public void testIndex() throws Exception {
    String view = subject.index(null, null);
    assertEquals("index", view);
  }

  @Test
  public void testMappings() throws Exception {
    String view = subject.index(new TestingAuthenticationToken("principal", "N/A"), new ModelMap());
    assertEquals("redirect:/mappings", view);
  }

  @Test
  public void testLanding() throws Exception {
    String view = subject.mappings(new TestingAuthenticationToken("principal", "N/A"), new ModelMap());
    assertEquals("mappings", view);
  }
}

@@ -14,16 +14,38 @@
 ntrol;%0A%0A
+import am.model.User;%0A
 import o
@@ -570,35 +570,34 @@
 cationToken(
-%22principal%22
+new User()
 , %22N/A%22), ne
@@ -787,19 +787,18 @@
 ken(
-%22principal%22
+new User()
 , %22N

Fix build