Package org.springframework.web.socket.handler

Examples of org.springframework.web.socket.handler.TestPrincipal


  }


  @Test
  public void getPrincipalWithConstructorArg() {
    TestPrincipal user = new TestPrincipal("joe");
    JettyWebSocketSession session = new JettyWebSocketSession(attributes, user);

    assertSame(user, session.getPrincipal());
  }
View Full Code Here


  }

  @Test
  public void getPrincipalFromNativeSession() {

    TestPrincipal user = new TestPrincipal("joe");

    UpgradeRequest request = Mockito.mock(UpgradeRequest.class);
    given(request.getUserPrincipal()).willReturn(user);

    UpgradeResponse response = Mockito.mock(UpgradeResponse.class);
View Full Code Here

  }


  @Test
  public void getPrincipalWithConstructorArg() {
    TestPrincipal user = new TestPrincipal("joe");
    StandardWebSocketSession session = new StandardWebSocketSession(this.headers, this.attributes, null, null, user);

    assertSame(user, session.getPrincipal());
  }
View Full Code Here

  }

  @Test
  public void getPrincipalWithNativeSession() {

    TestPrincipal user = new TestPrincipal("joe");

    Session nativeSession = Mockito.mock(Session.class);
    given(nativeSession.getUserPrincipal()).willReturn(user);

    StandardWebSocketSession session = new StandardWebSocketSession(this.headers, this.attributes, null, null);
View Full Code Here

TOP

Related Classes of org.springframework.web.socket.handler.TestPrincipal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.