Package org.springframework.messaging.simp

Examples of org.springframework.messaging.simp.TestPrincipal


    this.channel = Mockito.mock(MessageChannel.class);
    this.messageCaptor = ArgumentCaptor.forClass(Message.class);

    this.session = new TestWebSocketSession();
    this.session.setId("s1");
    this.session.setPrincipal(new TestPrincipal("joe"));
  }
View Full Code Here


  private TestPrincipal user;


  @Before
  public void setup() {
    this.user = new TestPrincipal("joe");
    this.registry = new DefaultUserSessionRegistry();
    this.registry.registerSessionId(this.user.getName(), SESSION_ID);
    this.resolver = new DefaultUserDestinationResolver(this.registry);
  }
View Full Code Here

    SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.create(messageType);
    if (destination != null) {
      headers.setDestination(destination);
    }
    if (user != null) {
      headers.setUser(new TestPrincipal(user));
    }
    if (sessionId != null) {
      headers.setSessionId(sessionId);
    }
    return MessageBuilder.withPayload(new byte[0]).setHeaders(headers).build();
View Full Code Here

TOP

Related Classes of org.springframework.messaging.simp.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.