<commit_before>Feature: Thorough stack analysis v3 API tests for Maven ecosystem


  Scenario: Check that the API entry point requires authorization token
    Given System is running
    When I send Maven package manifest pom.xml to stack analysis version 3 without authorization token
    Then I should get 401 status code


  @requires_authorization_token
  Scenario: Check that the API entry point requires authorization token
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest pom.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code


  @requires_authorization_token
  Scenario: Check that the stack analysis response for the pom.xml that contains only one component
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest pom.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response
     And I should receive JSON response containing the status key
     And I should receive JSON response containing the id key
     And I should receive JSON response containing the submitted_at key
     And I should receive JSON response with the status key set to success
     And I should receive JSON response with the correct id
     And I should receive JSON response with the correct timestamp in attribute submitted_at

    # wait for response from stack analysis
    When I wait for stack analysis version 3 to finish with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response

    # Timestamp checks
    When I look at recent stack analysis
    Then I should receive JSON response containing the started_at key
     And I should receive JSON response containing the finished_at key
     And I should receive JSON response with the correct timestamp in attribute started_at
     And I should receive JSON response with the correct timestamp in attribute finished_at

    # Request ID check
    When I look at recent stack analysis
    Then I should receive JSON response containing the request_id key

    # Analyzed component check
    When I look at recent stack analysis
    Then I should find analyzed dependency named junit:junit with version 3.8.1 in the stack analysis


  @requires_authorization_token
  Scenario: Check that the stack analysis response for the springboot.xml
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest springboot.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response
     And I should receive JSON response containing the status key
     And I should receive JSON response containing the id key
     And I should receive JSON response containing the submitted_at key
     And I should receive JSON response with the status key set to success
     And I should receive JSON response with the correct id
     And I should receive JSON response with the correct timestamp in attribute submitted_at

    # wait for response from stack analysis
    When I wait for stack analysis version 3 to finish with authorization token
    Then I should get 200 status code

    # Timestamp checks
    When I look at recent stack analysis
    Then I should receive JSON response containing the started_at key
     And I should receive JSON response containing the finished_at key
     And I should receive JSON response with the correct timestamp in attribute started_at
     And I should receive JSON response with the correct timestamp in attribute finished_at

    # Request ID check
    When I look at recent stack analysis
    Then I should receive JSON response containing the request_id key

    # Analyzed component check
    When I look at recent stack analysis
    Then I should find analyzed dependency named org.springframework:spring-messaging with version 4.3.7.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework.boot:spring-boot-starter-web with version 1.5.2.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework:spring-websocket with version 4.3.7.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework.boot:spring-boot-starter with version 1.5.2.RELEASE in the stack analysis


  @requires_authorization_token
  Scenario: Check that the stack analysis response for the vertx.xml
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest vertx.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response
     And I should receive JSON response containing the status key
     And I should receive JSON response containing the id key
     And I should receive JSON response containing the submitted_at key
     And I should receive JSON response with the status key set to success
     And I should receive JSON response with the correct id
     And I should receive JSON response with the correct timestamp in attribute submitted_at

    When I wait for stack analysis version 3 to finish with authorization token
    Then I should get 200 status code

    # Timestamp checks
    When I look at recent stack analysis
    Then I should receive JSON response containing the started_at key
     And I should receive JSON response containing the finished_at key
     And I should receive JSON response with the correct timestamp in attribute started_at
     And I should receive JSON response with the correct timestamp in attribute finished_at

    # Request ID check
    When I look at recent stack analysis
    Then I should receive JSON response containing the request_id key

    # Analyzed component check
    When I look at recent stack analysis
    Then I should find analyzed dependency named io.vertx:vertx-core with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-templ-freemarker with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-jdbc-client with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-templ-handlebars with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-rx-java with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-client with version 3.4.1 in the stack analysis
<commit_msg>Updated tests for Maven ecosystem<commit_after>Feature: Thorough stack analysis v3 API tests for Maven ecosystem


  Scenario: Check that the API entry point requires authorization token
    Given System is running
    When I send Maven package manifest pom.xml to stack analysis version 3 without authorization token
    Then I should get 401 status code


  @requires_authorization_token
  Scenario: Check that the API entry point requires authorization token
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest pom.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code


  @requires_authorization_token
  Scenario: Check that the stack analysis response for the pom.xml that contains only one component
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest pom.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response
     And I should receive JSON response containing the status key
     And I should receive JSON response containing the id key
     And I should receive JSON response containing the submitted_at key
     And I should receive JSON response with the status key set to success
     And I should receive JSON response with the correct id
     And I should receive JSON response with the correct timestamp in attribute submitted_at

    # wait for response from stack analysis
    When I wait for stack analysis version 3 to finish with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response

    # Timestamp checks
    When I look at recent stack analysis
    Then I should receive JSON response containing the started_at key
     And I should receive JSON response containing the finished_at key
     And I should receive JSON response with the correct timestamp in attribute started_at
     And I should receive JSON response with the correct timestamp in attribute finished_at

    # Request ID check
    When I look at recent stack analysis
    Then I should receive JSON response containing the request_id key

    # Dependencies checks
    When I look at recent stack analysis
    Then I should find at least 1 dependencies
     And I should find the following dependencies (junit:junit) in the stack analysis
     And I should find dependency named junit:junit with version 3.8.1 in the stack analysis

    # Analyzed dependencies checks
    When I look at recent stack analysis
    Then I should find at least 1 analyzed dependencies
     And I should find the following analyzed dependencies (junit:junit) in the stack analysis
     And I should find analyzed dependency named junit:junit with version 3.8.1 in the stack analysis

    # Unknown dependencies checks
    When I look at recent stack analysis
    Then I should find no more than 0 unknown dependencies


  @requires_authorization_token
  Scenario: Check that the stack analysis response for the springboot.xml
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest springboot.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response
     And I should receive JSON response containing the status key
     And I should receive JSON response containing the id key
     And I should receive JSON response containing the submitted_at key
     And I should receive JSON response with the status key set to success
     And I should receive JSON response with the correct id
     And I should receive JSON response with the correct timestamp in attribute submitted_at

    # wait for response from stack analysis
    When I wait for stack analysis version 3 to finish with authorization token
    Then I should get 200 status code

    # Timestamp checks
    When I look at recent stack analysis
    Then I should receive JSON response containing the started_at key
     And I should receive JSON response containing the finished_at key
     And I should receive JSON response with the correct timestamp in attribute started_at
     And I should receive JSON response with the correct timestamp in attribute finished_at

    # Request ID check
    When I look at recent stack analysis
    Then I should receive JSON response containing the request_id key

    # Analyzed component check
    When I look at recent stack analysis
    Then I should find at least 4 dependencies
     And I should find the following dependencies (org.springframework.boot:spring-boot-starter-web, org.springframework.boot:spring-boot-starter, org.springframework:spring-messaging, org.springframework:spring-websocket) in the stack analysis
     And I should find analyzed dependency named org.springframework:spring-messaging with version 4.3.7.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework.boot:spring-boot-starter-web with version 1.5.2.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework:spring-websocket with version 4.3.7.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework.boot:spring-boot-starter with version 1.5.2.RELEASE in the stack analysis

    # Analyzed dependencies checks
    When I look at recent stack analysis
    Then I should find at least 4 analyzed dependencies
     And I should find the following analyzed dependencies (org.springframework.boot:spring-boot-starter-web, org.springframework.boot:spring-boot-starter, org.springframework:spring-messaging, org.springframework:spring-websocket) in the stack analysis
     And I should find analyzed dependency named org.springframework.boot:spring-boot-starter-web with version 1.5.2.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework.boot:spring-boot-starter with version 1.5.2.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework:spring-messaging with version 4.3.7.RELEASE in the stack analysis
     And I should find analyzed dependency named org.springframework:spring-websocket with version 4.3.7.RELEASE in the stack analysis

    # Unknown dependencies checks
    When I look at recent stack analysis
    Then I should find no more than 0 unknown dependencies


  @requires_authorization_token
  Scenario: Check that the stack analysis response for the vertx.xml
    Given System is running
    When I acquire the authorization token
    Then I should get the proper authorization token

    # request the stack analysis
    When I send Maven package manifest vertx.xml to stack analysis version 3 with authorization token
    Then I should get 200 status code
     And I should receive a valid JSON response
     And I should receive JSON response containing the status key
     And I should receive JSON response containing the id key
     And I should receive JSON response containing the submitted_at key
     And I should receive JSON response with the status key set to success
     And I should receive JSON response with the correct id
     And I should receive JSON response with the correct timestamp in attribute submitted_at

    When I wait for stack analysis version 3 to finish with authorization token
    Then I should get 200 status code

    # Timestamp checks
    When I look at recent stack analysis
    Then I should receive JSON response containing the started_at key
     And I should receive JSON response containing the finished_at key
     And I should receive JSON response with the correct timestamp in attribute started_at
     And I should receive JSON response with the correct timestamp in attribute finished_at

    # Request ID check
    When I look at recent stack analysis
    Then I should receive JSON response containing the request_id key

    # Analyzed component check
    When I look at recent stack analysis
    Then I should find at least 7 dependencies
     And I should find the following dependencies (io.vertx:vertx-core, io.vertx:vertx-jdbc-client, io.vertx:vertx-rx-java, io.vertx:vertx-web-client, io.vertx:vertx-web-templ-freemarker, io.vertx:vertx-web-templ-handlebars, io.vertx:vertx-web) in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-core with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-templ-freemarker with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-jdbc-client with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-templ-handlebars with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-rx-java with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-client with version 3.4.1 in the stack analysis

    # Analyzed dependencies checks
    When I look at recent stack analysis
    Then I should find at least 7 analyzed dependencies
     And I should find the following analyzed dependencies (io.vertx:vertx-core, io.vertx:vertx-jdbc-client, io.vertx:vertx-rx-java, io.vertx:vertx-web-client, io.vertx:vertx-web-templ-freemarker, io.vertx:vertx-web-templ-handlebars, io.vertx:vertx-web) in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-core with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-jdbc-client with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-rx-java with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-client with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-templ-freemarker with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web-templ-handlebars with version 3.4.1 in the stack analysis
     And I should find analyzed dependency named io.vertx:vertx-web with version 3.4.1 in the stack analysis

    # Unknown dependencies checks
    When I look at recent stack analysis
    Then I should find no more than 0 unknown dependencies
{'fraction_non_alphanumeric': 0.023452261865066132, 'fraction_numerical': 0.010170056685561854, 'mean_word_length': 3.6081946222791292, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4332788', 'n_tokens_mistral': 4260, 'n_tokens_neox': 3999, 'n_words': 2432}