test_class.declarator: httpServletResponse
test_class.modifier: private
test_class.original_string: private HttpServletResponse      httpServletResponse;
test_class.type: HttpServletResponse
test_class.var_name: httpServletResponse
test_class.declarator: containerResponse
test_class.modifier: private
test_class.original_string: private GenericContainerResponse containerResponse;
test_class.type: GenericContainerResponse
test_class.var_name: containerResponse
test_class.declarator: servletContainerResponseWriter
test_class.modifier: private
test_class.original_string: private ServletContainerResponseWriter servletContainerResponseWriter;
test_class.type: ServletContainerResponseWriter
test_class.var_name: servletContainerResponseWriter
test_class.file: everrest-core/src/test/java/org/everrest/core/servlet/ServletContainerResponseWriterTest.java
test_class.identifier: ServletContainerResponseWriterTest
test_case.body: @Test
      public void writesStatusAndHeaders() throws Exception {
          MultivaluedMap<String, Object> responseHeaders = new MultivaluedHashMap<>();
          responseHeaders.putSingle("content-type", "text/plain");
          when(containerResponse.getStatus()).thenReturn(200);
          when(containerResponse.getHttpHeaders()).thenReturn(responseHeaders);
  
          servletContainerResponseWriter.writeHeaders(containerResponse);
  
          verify(httpServletResponse).setStatus(eq(200));
          verify(httpServletResponse).addHeader(eq("content-type"), eq("text/plain"));
      }
test_case.class_method_signature: ServletContainerResponseWriterTest.writesStatusAndHeaders()
test_case.full_signature: @Test public void writesStatusAndHeaders()
test_case.identifier: writesStatusAndHeaders
test_case.invocations: putSingle thenReturn when getStatus thenReturn when getHttpHeaders writeHeaders setStatus verify eq addHeader verify eq eq
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void writesStatusAndHeaders()
focal_class.declarator: servletResponse
focal_class.modifier: private final
focal_class.original_string: private final HttpServletResponse servletResponse;
focal_class.type: HttpServletResponse
focal_class.var_name: servletResponse
focal_class.file: everrest-core/src/main/java/org/everrest/core/servlet/ServletContainerResponseWriter.java
focal_class.identifier: ServletContainerResponseWriter
focal_class.interfaces: implements ContainerResponseWriter
focal_class.class_method_signature: ServletContainerResponseWriter.ServletContainerResponseWriter(HttpServletResponse response)
focal_class.full_signature: public  ServletContainerResponseWriter(HttpServletResponse response)
focal_class.identifier: ServletContainerResponseWriter
focal_class.modifiers: public
focal_class.parameters: (HttpServletResponse response)
focal_class.signature:  ServletContainerResponseWriter(HttpServletResponse response)
focal_class.class_method_signature: ServletContainerResponseWriter.writeBody(GenericContainerResponse response, MessageBodyWriter entityWriter)
focal_class.full_signature: @Override @SuppressWarnings({"unchecked"}) public void writeBody(GenericContainerResponse response, MessageBodyWriter entityWriter)
focal_class.identifier: writeBody
focal_class.modifiers: @Override @SuppressWarnings({"unchecked"}) public
focal_class.parameters: (GenericContainerResponse response, MessageBodyWriter entityWriter)
focal_class.return: void
focal_class.signature: void writeBody(GenericContainerResponse response, MessageBodyWriter entityWriter)
focal_class.class_method_signature: ServletContainerResponseWriter.writeHeaders(GenericContainerResponse response)
focal_class.full_signature: @Override public void writeHeaders(GenericContainerResponse response)
focal_class.identifier: writeHeaders
focal_class.modifiers: @Override public
focal_class.parameters: (GenericContainerResponse response)
focal_class.return: void
focal_class.signature: void writeHeaders(GenericContainerResponse response)
focal_method.body: @Override
      public void writeHeaders(GenericContainerResponse response) throws IOException {
          if (servletResponse.isCommitted()) {
              return;
          }
  
          servletResponse.setStatus(response.getStatus());
  
          if (response.getHttpHeaders() != null) {
              // content-type and content-length should be preset in headers
              for (Map.Entry<String, List<Object>> e : response.getHttpHeaders().entrySet()) {
                  String name = e.getKey();
                  for (Object o : e.getValue()) {
                      String value;
                      if (o != null && (value = HeaderHelper.getHeaderAsString(o)) != null) {
                          servletResponse.addHeader(name, value);
                      }
                  }
              }
          }
      }
focal_method.class_method_signature: ServletContainerResponseWriter.writeHeaders(GenericContainerResponse response)
focal_method.full_signature: @Override public void writeHeaders(GenericContainerResponse response)
focal_method.identifier: writeHeaders
focal_method.invocations: isCommitted setStatus getStatus getHttpHeaders entrySet getHttpHeaders getKey getValue getHeaderAsString addHeader
focal_method.modifiers: @Override public
focal_method.parameters: (GenericContainerResponse response)
focal_method.return: void
focal_method.signature: void writeHeaders(GenericContainerResponse response)