Search in sources :

Example 11 with PayloadExchange

use of org.springframework.security.rsocket.api.PayloadExchange in project spring-security by spring-projects.

the class PayloadSocketAcceptorTests method acceptWhenDefaultMetadataMimeTypeOverrideThenDefaulted.

@Test
public void acceptWhenDefaultMetadataMimeTypeOverrideThenDefaulted() {
    this.acceptor.setDefaultMetadataMimeType(MediaType.APPLICATION_JSON);
    given(this.setupPayload.dataMimeType()).willReturn(MediaType.APPLICATION_JSON_VALUE);
    PayloadExchange exchange = captureExchange();
    assertThat(exchange.getMetadataMimeType()).isEqualTo(MediaType.APPLICATION_JSON);
    assertThat(exchange.getDataMimeType()).isEqualTo(MediaType.APPLICATION_JSON);
}
Also used : PayloadExchange(org.springframework.security.rsocket.api.PayloadExchange) Test(org.junit.jupiter.api.Test)

Aggregations

PayloadExchange (org.springframework.security.rsocket.api.PayloadExchange)11 Test (org.junit.jupiter.api.Test)9 RSocket (io.rsocket.RSocket)2 TestingAuthenticationToken (org.springframework.security.authentication.TestingAuthenticationToken)2 DefaultPayloadExchange (org.springframework.security.rsocket.core.DefaultPayloadExchange)2 SocketAcceptor (io.rsocket.SocketAcceptor)1 UsernamePasswordAuthenticationToken (org.springframework.security.authentication.UsernamePasswordAuthenticationToken)1 Authentication (org.springframework.security.core.Authentication)1 PayloadInterceptorChain (org.springframework.security.rsocket.api.PayloadInterceptorChain)1