Class: Crucible::Tests::TransactionAndBatchTest

Inherits:
BaseSuite show all
Defined in:
lib/tests/suites/transaction_test.rb

Constant Summary

Constants inherited from BaseSuite

BaseSuite::EXCLUDED_RESOURCES

Constants inherited from BaseTest

BaseTest::BASE_SPEC_LINK, BaseTest::JSON_FIELDS, BaseTest::METADATA_FIELDS, BaseTest::REST_SPEC_LINK, BaseTest::STATUS

Instance Attribute Summary

Attributes inherited from BaseTest

#category, #tags, #tests_subset, #warnings

Instance Method Summary collapse

Methods inherited from BaseSuite

#build_messages, #collect_metadata, fhir_resources, #links, #metadata, #parse_operation_outcome, #requires, #resource_category, test, #title, #validates

Methods inherited from BaseTest

#author, #details, #execute, #execute_test_method, #execute_test_methods, #ignore_client_exception, #multiserver, #requires_authorization, #tests, #warning

Methods included from Assertions

#assert, #assert_bundle_entry_count, #assert_bundle_response, #assert_bundle_transactions_okay, #assert_equal, #assert_etag_present, #assert_last_modified_present, #assert_minimum, #assert_navigation_links, #assert_operator, #assert_resource_content_type, #assert_resource_type, #assert_response_bad, #assert_response_code, #assert_response_conflict, #assert_response_created, #assert_response_gone, #assert_response_not_found, #assert_response_ok, #assert_valid_content_location_present, #assert_valid_profile, #assert_valid_resource_content_type_present, #assertion_negated, #skip

Constructor Details

#initialize(client1, client2 = nil) ⇒ TransactionAndBatchTest

Returns a new instance of TransactionAndBatchTest.



13
14
15
16
# File 'lib/tests/suites/transaction_test.rb', line 13

def initialize(client1, client2=nil)
  super(client1, client2)
  @category = {id: 'core_functionality', title: 'Core Functionality'}
end

Instance Method Details

#descriptionObject



9
10
11
# File 'lib/tests/suites/transaction_test.rb', line 9

def description
  'Test server support for transactions and batch processing including conditional logic.'
end

#idObject



5
6
7
# File 'lib/tests/suites/transaction_test.rb', line 5

def id
  'TransactionAndBatchTest'
end

#setupObject



18
19
20
# File 'lib/tests/suites/transaction_test.rb', line 18

def setup
  # nothing
end

#teardownObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/tests/suites/transaction_test.rb', line 22

def teardown
  # delete resources
  @client.destroy(FHIR::Observation, @obs4.id) if @obs4 && !@obs4.id.nil?
  @client.destroy(FHIR::Observation, @obs3.id) if @obs3 && !@obs3.id.nil?
  @client.destroy(FHIR::Observation, @obs2.id) if @obs2 && !@obs2.id.nil?
  @client.destroy(FHIR::Observation, @obs1.id) if @obs1 && !@obs1.id.nil?
  @client.destroy(FHIR::Observation, @obs0a.id) if @obs0a && !@obs0a.id.nil?
  @client.destroy(FHIR::Observation, @obs0b.id) if @obs0b && !@obs0b.id.nil?
  @client.destroy(FHIR::Condition, @condition0.id) if @condition0 && !@condition0.id.nil?
  @client.destroy(FHIR::Condition, @conditionId) if @conditionId
  @client.destroy(FHIR::Patient, @patient0.id) if @patient0 && !@patient0.id.nil?
  @client.destroy(FHIR::Patient, @patient1.id) if @patient1 && !@patient1.id.nil?
  @client.destroy(FHIR::Patient, @badPatientId) if @badPatientId
  @transferIds.each do |klass,list|
    list.each do |id|
      @client.destroy(klass, id) if(!id.nil? && !id.strip.empty?)
    end
  end unless @transferIds.nil?
  @client.destroy(FHIR::Observation, @batch_obs.id) if @batch_obs && !@batch_obs.id.nil?
  @client.destroy(FHIR::Patient, @batch_patient.id) if @batch_patient && !@batch_patient.id.nil?
  @client.destroy(FHIR::Observation, @batch_obs_2.id) if @batch_obs_2 && !@batch_obs_2.id.nil?
  @client.destroy(FHIR::Observation, @batch_obs_3.id) if @batch_obs_3 && !@batch_obs_3.id.nil?
  @client.destroy(FHIR::Patient, @batch_patient_2.id) if @batch_patient_2 && !@batch_patient_2.id.nil?
end