示例#1
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: private javax.ws.rs.core.Response.ResponseBuilder mockResponseBuilder(javax.ws.rs.core.Response response, final java.util.concurrent.atomic.AtomicReference<javax.ws.rs.core.StreamingOutput> ref)
        private Response.ResponseBuilder MockResponseBuilder(Response response, AtomicReference <StreamingOutput> @ref)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final javax.ws.rs.core.Response.ResponseBuilder responseBuilder = mock(javax.ws.rs.core.Response.ResponseBuilder.class);
            Response.ResponseBuilder responseBuilder = mock(typeof(Response.ResponseBuilder));
            when(responseBuilder.entity(ArgumentMatchers.isA(typeof(StreamingOutput)))).thenAnswer(invocationOnMock =>
            {
                @ref.set(invocationOnMock.getArgument(0));
                return(responseBuilder);
            });
            when(responseBuilder.type(ArgumentMatchers.any <MediaType>())).thenReturn(responseBuilder);
            when(responseBuilder.build()).thenReturn(response);
            return(responseBuilder);
        }