<commit_before>require "spec_helper"

describe Nordea::FileTransfer::Client do
  subject :client do
    Nordea::FileTransfer::Client.new(
      :cert_file => cert_file,
      :private_key_file => cert_file
    )
  end

  let :cert_file do
    File.expand_path('../../../certs/WSNDEA1234.pem', __FILE__)
  end

  describe "GetUserInfo" do
    it "should send a request and return response" do
      response = VCR.use_cassette('get_user_info') do
        client.request(:get_user_info) do |r|
          r.request_header.attributes = {
            :sender_id   => 11111111,
            :request_id  => 1232,
            :timestamp   => Time.now,
            :language    => "EN",
            :user_agent  => "Ruby",
            :receiver_id => 123456789
          }
          r.application_request.attributes = {
            :customer_id      => 162355330,
            :command          => "GetUserInfo",
            :timestamp        => Time.now,
            :environment      => "PRODUCTION",
            :execution_serial => "001",
            :software_id      => "Ruby"
          }
        end
      end

      response.response_header.request_id.should == "1232"
      response.application_response.user_file_types.size.should be > 0
    end
  end

  describe "DownloadFileList" do
    it "does something" do
      response = VCR.use_cassette('download_file_list') do<commit_msg>Fix DownloadFileList spec example name<commit_after>require "spec_helper"

describe Nordea::FileTransfer::Client do
  subject :client do
    Nordea::FileTransfer::Client.new(
      :cert_file => cert_file,
      :private_key_file => cert_file
    )
  end

  let :cert_file do
    File.expand_path('../../../certs/WSNDEA1234.pem', __FILE__)
  end

  describe "GetUserInfo" do
    it "should send a request and return response" do
      response = VCR.use_cassette('get_user_info') do
        client.request(:get_user_info) do |r|
          r.request_header.attributes = {
            :sender_id   => 11111111,
            :request_id  => 1232,
            :timestamp   => Time.now,
            :language    => "EN",
            :user_agent  => "Ruby",
            :receiver_id => 123456789
          }
          r.application_request.attributes = {
            :customer_id      => 162355330,
            :command          => "GetUserInfo",
            :timestamp        => Time.now,
            :environment      => "PRODUCTION",
            :execution_serial => "001",
            :software_id      => "Ruby"
          }
        end
      end

      response.response_header.request_id.should == "1232"
      response.application_response.user_file_types.size.should be > 0
    end
  end

  describe "DownloadFileList" do
    it "should send a request and return response" do
      response = VCR.use_cassette('download_file_list') do
{'fraction_non_alphanumeric': 0.10645848119233499, 'fraction_numerical': 0.029808374733853796, 'mean_word_length': 2.024678111587983, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3940800', 'n_tokens_mistral': 920, 'n_tokens_neox': 835, 'n_words': 174}