<commit_before>Feature: Components API V1

  Scenario: Check the API entry point
    Given System is running
    When I access /api/v1/
    Then I should get 200 status code

  Scenario: Check if component analysis requires authorization
    Given System is running
    Given Component search service is running
    When I wait 60 seconds
    When I search for component sequence without authorization token
    Then I should get 401 status code

  @requires_authorization_token
  Scenario: Check the component search API entry point
    Given System is running
    Given Component search service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I search for component foobar with authorization token
    Then I should get 200 status code

  Scenario: Check that the component search API entry point requires component name
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-search
    Then I should get 404 status code

  Scenario: Check that the component search API entry point checks for empty component name
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-search/
    Then I should get 404 status code

  Scenario: Check that the component analyses API entry point make sure resources are specified
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-analyses/
    Then I should get 404 status code

  @requires_authorization_token
  Scenario: Check if search for packages handle empty results
    Given System is running
    Given Component search service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I search for component foobar with authorization token
    Then I should get 200 status code
    Then I should see 0 components

  Scenario: Check that component analyses endpoint checks if all resources are specified
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-analyses
    Then I should get 404 status code
    When I access /api/v1/component-analyses/npm
    Then I should get 404 status code
    When I access /api/v1/component-analyses/component
    Then I should get 404 status code

  Scenario: Check if component analysis requires authorization
    Given System is running
    Given Component search service is running
    When I start analysis for component npm/sequence/2.2.0
    Then I should get 401 status code
<commit_msg>New test: check if component analysis is available via API<commit_after>Feature: Components API V1

  Scenario: Check the API entry point
    Given System is running
    When I access /api/v1/
    Then I should get 200 status code

  Scenario: Check if component analysis requires authorization
    Given System is running
    Given Component search service is running
    When I wait 60 seconds
    When I search for component sequence without authorization token
    Then I should get 401 status code

  @requires_authorization_token
  Scenario: Check the component search API entry point
    Given System is running
    Given Component search service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I search for component foobar with authorization token
    Then I should get 200 status code

  Scenario: Check that the component search API entry point requires component name
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-search
    Then I should get 404 status code

  Scenario: Check that the component search API entry point checks for empty component name
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-search/
    Then I should get 404 status code

  Scenario: Check that the component analyses API entry point make sure resources are specified
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-analyses/
    Then I should get 404 status code

  @requires_authorization_token
  Scenario: Check if search for packages handle empty results
    Given System is running
    Given Component search service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I search for component foobar with authorization token
    Then I should get 200 status code
    Then I should see 0 components

  Scenario: Check that component analyses endpoint checks if all resources are specified
    Given System is running
    Given Component search service is running
    When I access /api/v1/component-analyses
    Then I should get 404 status code
    When I access /api/v1/component-analyses/npm
    Then I should get 404 status code
    When I access /api/v1/component-analyses/component
    Then I should get 404 status code

  Scenario: Check if component analysis requires authorization
    Given System is running
    Given Component search service is running
    When I start analysis for component npm/sequence/2.2.0
    Then I should get 401 status code

  Scenario: Check if component analysis is accessible via API
    Given System is running
    Given Component search service is running
    When I acquire the authorization token
    Then I should get the proper authorization token
    When I read npm/sequence/2.2.0 component analysis using authorization token
    Then I should get 200 status code

{'fraction_non_alphanumeric': 0.018767705382436262, 'fraction_numerical': 0.017705382436260624, 'mean_word_length': 3.3587962962962963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5775397', 'n_tokens_mistral': 1392, 'n_tokens_neox': 1243, 'n_words': 772}