Search in sources :

Example 11 with DefaultErrorContractDTO

use of com.nike.backstopper.model.DefaultErrorContractDTO in project riposte by Nike-Inc.

the class ErrorResponseBodyImplTest method copy_constructor_throws_IllegalArgumentException_when_passed_DTO_with_null_errorId.

@Test
public void copy_constructor_throws_IllegalArgumentException_when_passed_DTO_with_null_errorId() {
    // when
    Throwable ex = catchThrowable(() -> new ErrorResponseBodyImpl(new DefaultErrorContractDTO(null, Collections.emptyList())));
    // then
    Assertions.assertThat(ex).isInstanceOf(IllegalArgumentException.class).hasMessage("The DefaultErrorContractDTO.error_id value cannot be null.");
}
Also used : DefaultErrorContractDTO(com.nike.backstopper.model.DefaultErrorContractDTO) Assertions.catchThrowable(org.assertj.core.api.Assertions.catchThrowable) Test(org.junit.Test)

Aggregations

DefaultErrorContractDTO (com.nike.backstopper.model.DefaultErrorContractDTO)11 Test (org.junit.Test)7 ApiError (com.nike.backstopper.apierror.ApiError)2 ErrorResponseBodyImpl (com.nike.backstopper.model.riposte.ErrorResponseBodyImpl)2 ErrorResponseBody (com.nike.riposte.server.error.handler.ErrorResponseBody)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 SampleCoreApiError (com.nike.backstopper.apierror.sample.SampleCoreApiError)1 DefaultErrorDTO (com.nike.backstopper.model.DefaultErrorDTO)1 Pair (com.nike.internal.util.Pair)1 Bootstrap (io.netty.bootstrap.Bootstrap)1 Channel (io.netty.channel.Channel)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 ChannelPipeline (io.netty.channel.ChannelPipeline)1 EventLoopGroup (io.netty.channel.EventLoopGroup)1 SimpleChannelInboundHandler (io.netty.channel.SimpleChannelInboundHandler)1 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)1 SocketChannel (io.netty.channel.socket.SocketChannel)1 NioSocketChannel (io.netty.channel.socket.nio.NioSocketChannel)1 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)1 FullHttpResponse (io.netty.handler.codec.http.FullHttpResponse)1