test_class.file: http/src/test/java/ro/polak/http/protocol/parser/impl/RequestStatusParserTest.java
test_class.identifier: RequestStatusParserTest
test_case.body: @Test(expected = MalformedInputException.class)
      public void shouldThrowMalformedInputExceptionOnInvalidStatus() throws MalformedInputException {
          Parser<RequestStatus> requestStatusParser = new RequestStatusParser();
          requestStatusParser.parse("GET HTTP/1.1");
      }
test_case.class_method_signature: RequestStatusParserTest.shouldThrowMalformedInputExceptionOnInvalidStatus()
test_case.full_signature: @Test(expected = MalformedInputException.class) public void shouldThrowMalformedInputExceptionOnInvalidStatus()
test_case.identifier: shouldThrowMalformedInputExceptionOnInvalidStatus
test_case.invocations: parse
test_case.modifiers: @Test(expected = MalformedInputException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldThrowMalformedInputExceptionOnInvalidStatus()
focal_class.declarator: NUMBER_OF_CHUNKS = 3
focal_class.modifier: private static final
focal_class.original_string: private static final int NUMBER_OF_CHUNKS = 3;
focal_class.type: int
focal_class.var_name: NUMBER_OF_CHUNKS
focal_class.declarator: STATUS_SEPARATOR = " "
focal_class.modifier: private static final
focal_class.original_string: private static final String STATUS_SEPARATOR = " ";
focal_class.type: String
focal_class.var_name: STATUS_SEPARATOR
focal_class.declarator: QUERY_STRING_START = "?"
focal_class.modifier: private static final
focal_class.original_string: private static final String QUERY_STRING_START = "?";
focal_class.type: String
focal_class.var_name: QUERY_STRING_START
focal_class.file: http/src/main/java/ro/polak/http/protocol/parser/impl/RequestStatusParser.java
focal_class.identifier: RequestStatusParser
focal_class.interfaces: implements Parser<RequestStatus>
focal_class.class_method_signature: RequestStatusParser.parse(final String input)
focal_class.full_signature: @Override public RequestStatus parse(final String input)
focal_class.identifier: parse
focal_class.modifiers: @Override public
focal_class.parameters: (final String input)
focal_class.return: RequestStatus
focal_class.signature: RequestStatus parse(final String input)
focal_method.body: @Override
      public RequestStatus parse(final String input) throws MalformedInputException {
          RequestStatus status = new RequestStatus();
          status.setQueryString("");
          String uri;
  
  
          String[] statusArray = input.split(STATUS_SEPARATOR, NUMBER_OF_CHUNKS);
  
          if (statusArray.length < NUMBER_OF_CHUNKS) {
              throw new MalformedInputException("Input status string should be composed out of "
                      + NUMBER_OF_CHUNKS + " chunks. Received " + input);
          }
  
          // First element of the array is the HTTP method
          status.setMethod(statusArray[0].toUpperCase());
          // Second element of the array is the HTTP queryString
          uri = statusArray[1];
  
          // Protocol is the third part of the status line
          status.setProtocol(statusArray[2].trim());
  
          int questionMarkPosition = uri.indexOf(QUERY_STRING_START);
          if (questionMarkPosition > -1) {
              status.setQueryString(uri.substring(questionMarkPosition + 1));
              uri = uri.substring(0, questionMarkPosition);
          }
          status.setUri(uri);
          return status;
      }
focal_method.class_method_signature: RequestStatusParser.parse(final String input)
focal_method.full_signature: @Override public RequestStatus parse(final String input)
focal_method.identifier: parse
focal_method.invocations: setQueryString split setMethod toUpperCase setProtocol trim indexOf setQueryString substring substring setUri
focal_method.modifiers: @Override public
focal_method.parameters: (final String input)
focal_method.return: RequestStatus
focal_method.signature: RequestStatus parse(final String input)