use of org.springframework.core.testfixture.security.TestPrincipal in project spring-framework by spring-projects.
the class SimpMessageHeaderAccessorTests method getLogMessageWithValuesSet.
@Test
public void getLogMessageWithValuesSet() {
SimpMessageHeaderAccessor accessor = SimpMessageHeaderAccessor.create();
accessor.setDestination("/destination");
accessor.setSubscriptionId("subscription");
accessor.setSessionId("session");
accessor.setUser(new TestPrincipal("user"));
accessor.setSessionAttributes(Collections.<String, Object>singletonMap("key", "value"));
assertThat(accessor.getShortLogMessage("p")).isEqualTo(("MESSAGE destination=/destination subscriptionId=subscription " + "session=session user=user attributes[1] payload=p"));
}
Aggregations