Example usage for org.springframework.security.web.authentication WebAuthenticationDetails equals

List of usage examples for org.springframework.security.web.authentication WebAuthenticationDetails equals

Introduction

In this page you can find the example usage for org.springframework.security.web.authentication WebAuthenticationDetails equals.

Prototype

@Override
    public boolean equals(Object obj) 

Source Link

Usage

From source file:org.springframework.security.web.jackson2.WebAuthenticationDetailsMixinTest.java

@Test
public void buildWebAuthenticationDetailsUsingDifferentConstructors() throws IOException {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setRemoteAddr("localhost");
    request.setSession(new MockHttpSession(null, "1"));

    WebAuthenticationDetails details = new WebAuthenticationDetails(request);
    String jsonString = "{\"@class\": \"org.springframework.security.web.authentication.WebAuthenticationDetails\","
            + "\"sessionId\": \"1\", \"remoteAddress\": \"/localhost\"}";
    WebAuthenticationDetails authenticationDetails = this.mapper.readValue(jsonString,
            WebAuthenticationDetails.class);
    assertThat(details.equals(authenticationDetails));
}