IntegrationTestScenarios.feature 11.3 KB
Newer Older
David Diederich's avatar
David Diederich committed
1
2
3
4
5
6
7
8
Feature: Covers all positive and negative test cases around WKS transformation service

  # Pre-requisite test steps for all scenarios
  Background: Generate Access token
    Given I generate user token and prepare request header

  @WksService
  Scenario Outline: WKS Transformation should not be attempted if record is already a WKS record
9
10
    When I hit Storage service put end point with <payload> which is already a WKS record
    Then No corresponding transformed record should be created for this wks record in storage
David Diederich's avatar
David Diederich committed
11
12
13
14
15
16
17

    Examples: 
      | payload                                       |
      | "/input_payloads/payload_for_wks_record.json" |

  @WksService
  Scenario Outline: WKS Transformation should not be attempted if record is a WKE record
18
19
    When I hit Storage service put end point with <payload> which is already a WKE record
    Then No corresponding transformed record should be created for this wke record in storage
David Diederich's avatar
David Diederich committed
20
21
22
23
24
25
26

    Examples: 
      | payload                                       |
      | "/input_payloads/payload_for_wke_record.json" |

  @WksService
  Scenario Outline: WKS Transformation flow should be skipped if mapping is not present
27
28
    When I hit Storage service put end point with <payload> which has invalid source so that mapping service does not return any mapping
    Then No corresponding transformed record should be created for this record in storage
David Diederich's avatar
David Diederich committed
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

    Examples: 
      | payload                                            |
      | "/input_payloads/payload_with_invalid_source.json" |

  @WksService
  Scenario Outline: Wks record to be created on raw record creation. WKS record should be updated on corresponding raw record update.
    When I hit Storage service put end point with <payload>
    Then Transformed record should be created in storage
    And Wks record should be created in the intended kind
    When I hit Storage service put end point to update raw record with <updatePayload>
    Then Existing WKS record in storage should get updated

    Examples: 
      | payload                                             | updatePayload                                       |
      | "/input_payloads/payload_for_create_operation.json" | "/input_payloads/payload_for_update_operation.json" |

46
47
48
49
  @WksService_WIP
  Scenario Outline: Wks record to be created with tags attribute on raw record creation.
    When I hit Storage service put end point with <payload>
    Then Transformed record should be created in storage with <tagsblock>
50

51
52
53
54
    Examples: # This test case can be enabled after storage service is ready to accept tags attribute at root level
      | payload | tagsblock |
		 #| "/input_payloads/payload_withTagsAndMeta_for_create_operation.json" | "/input_payloads/payload_with_tags_In_output.json" |
  
55
56
57
58
59
60
61
62
  @WksService
  Scenario Outline: Multiple Wks records should be created on raw record creation. WKS records should be updated on corresponding raw record update.
    When I hit Storage service put end point with <payload>
    Then Transformed records should be created in storage
    And Wks records should be created in the intended kind
    When I hit Storage service put end point to update raw record with <updatePayload>
    Then Existing WKS records in storage should get updated

63
64
    Examples: 
      | payload                                                          | updatePayload                                                    |
65
      | "/input_payloads/payload_for_create_operation_multiple_wks.json" | "/input_payloads/payload_for_update_operation_multiple_wks.json" |
66

David Diederich's avatar
David Diederich committed
67
68
69
70
71
72
73
  @WksService
  Scenario Outline: Metablock should get updated as per mapping file and ancestry should be correctly updated.
    When I hit Storage service put end point with <payload>
    Then Raw Record should be created in Storage
    And Transformed record should be created in storage
    And Data block in wks should be transformed as defined in <expectedWksRecord> as per <MappingFile>
    And Ancestry block should be updated correctly
74

David Diederich's avatar
David Diederich committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
    #And Metablock references in the transformed record should be updated as defined in <expectedWksRecord> as per <MappingFile>
    Examples: 
      | payload                                              | expectedWksRecord                                        | MappingFile                        |
      | "/input_payloads/payload_for_meta_and_ancestry.json" | "/input_payloads/expected_transformed_record_draft.json" | "/input_payloads/mappingFile.json" |

  @WksService
  Scenario Outline: Transformation of all record in request payload should be attempted regardless of transformation failure for few records.
    When I hit Storage service put end point with <payload> having multiple records where few records are already Wks records
    Then Transformation of Wks records should be skipped
    And All other valid records should get transformed

    Examples: 
      | payload                                         |
      | "/input_payloads/payload_for_bulk_records.json" |
89
90
91

  @RelationshipValidation
  Scenario Outline: WKS record relationships block should show relation to wks record of related entity
92
93
94
95
    Given I hit Storage service put end point with <relatedEntityPayload> to persist a record say raw1
    And I verify that wks is created for above raw record
    When I hit Storage service put end point with <parentPayload> whose raw record contains relationship to record raw1
    Then Transformed record should contain relationship to wks of raw1 <relatedEntityPayload> as per <expectedRelationshipBlock>
96
97
98
99
100
101
102

    Examples: 
      | relatedEntityPayload                                       | parentPayload                                                             | expectedRelationshipBlock                                                        |
      | "/input_payloads/relationship/raw_having_wks_created.json" | "/input_payloads/relationship/recordRelatedToEntityHavingWksCreated.json" | "/input_payloads/relationship/expectedRelationship_for_rawHavingWksCreated.json" |

  @RelationshipValidation
  Scenario Outline: WKS record relationships block should show relation to wks records of all related entities
103
104
105
106
    Given I hit Storage service put end point with <relatedEntityPayload> to persist two records say raw1 and raw2
    And I verify that wks records are created for above raw records
    When I hit wks service with <parentPayload> whose raw record contains relationship to above records
    Then Transformed record should contain relationship to wks records of raw1 and raw2 <relatedEntityPayload> as per <expectedRelationshipBlock>
107
108
109
110
111
112
113

    Examples: 
      | relatedEntityPayload                                                | parentPayload                                                                       | expectedRelationshipBlock                                                                     |
      | "/input_payloads/relationship/multiple_raw_having_wks_created.json" | "/input_payloads/relationship/recordRelatedToMultipleEntitiesHavingWKSCreated.json" | "/input_payloads/relationship/expectedRelationship_for_multipleRelatedRawWithWksCreated.json" |

  @RelationshipValidation
  Scenario Outline: WKS record relationships block should show relation to related entity raw record if it's wks record is missing
114
115
116
117
    Given I hit Storage service put end point with <relatedEntityPayload> to persist a record,say raw1, for which there is no wks mapping present
    And I verify that wks record does not get created for above raw record
    When I hit wks service with <parentPayload> whose raw record contains relationship to record raw1
    And Transformed record should contain relationship to raw record raw1 <relatedEntityPayload> as per <expectedRelationshipBlock>
118

119
    Examples: 
120
121
      | relatedEntityPayload                                          | parentPayload                                                             | expectedRelationshipBlock                                                 |
      | "/input_payloads/relationship/raw_having_no_wks_mapping.json" | "/input_payloads/relationship/recordRelatedToAnotherRecordWithNoWKS.json" | "/input_payloads/relationship/expectedRelationship_for_rawWithNoWks.json" |
122

RPrakash3's avatar
RPrakash3 committed
123
  @RelationshipValidation
124
  Scenario Outline: WKS record relationships block should show relation to related entity raw record even if it is not available in system
125
126
    Given I hit wks service with <parentPayload> whose raw record contains relationship to non-existing record,say raw1
    Then Transformed record should contain relationship to record raw1 <parentPayload> as per <expectedRelationshipBlock>
127

128
    Examples: 
129
130
      | parentPayload                                                               | expectedRelationshipBlock                                                   |
      | "/input_payloads/relationship/recordRelatedToAnotherUnavailableRecord.json" | "/input_payloads/relationship/expectedRelationship_for_nonExistentRaw.json" |
131
132

  @RelationshipValidation
133
134
135
136
137
  Scenario Outline: WKS record relationships block should show relation to wks record created using mapping definition targeted to schema of same authority
    Given I hit Storage service put end point with <relatedEntityPayload> to persist a record say raw1
    And I verify that two wks records are created for this raw record raw1
    When I hit Storage service put end point with <parentPayload> whose raw record contains relationship to record raw1
    Then Transformed record should contain relationship to wks with same authority of raw1 <relatedEntityPayload> as per <expectedRelationshipBlock>
138

139
140
    Examples: 
      | relatedEntityPayload                                                  | parentPayload                                                                      | expectedRelationshipBlock                                                        |
141
      | "/input_payloads/relationship/raw_having_wks_created_log_entity.json" | "/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedLogEntity.json" | "/input_payloads/relationship/expectedRelationship_for_rawHavingWksCreated.json" |
142

143
  @RelationshipValidation
144
145
146
147
148
149
150
  Scenario Outline: WKS record relationships block should show relation to wks record created by wks service, with mapping definition targeted to schema of same authority and having higher major version
    Given I hit Storage service put end point with <relatedEntityPayload> to persist a record say raw1
    And I verify that three wks records are created for this raw record raw1
    And I hit Storage service put end point with record raw2 as per <relatedEntityPayload2> having raw1 in its ancestry block
    When I hit Storage service put end point with <parentPayload> whose raw record contains relationship to record raw1
    Then Transformed record should contain relationship to wks with same authority of raw1 <relatedEntityPayload> and with higher major version as per <expectedRelationshipBlock>

151
    Examples: 
152
153
      | relatedEntityPayload                                                   | relatedEntityPayload2                                                                  | parentPayload                                                                       | expectedRelationshipBlock                                                        |
      | "/input_payloads/relationship/raw_having_wks_created_well_entity.json" | "/input_payloads/relationship/recordRelatedToAnotherRawButNotCreatedByWKSService.json" | "/input_payloads/relationship/recordRelatedToEntityHavingWksCreatedWellEntity.json" | "/input_payloads/relationship/expectedRelationship_for_rawHavingWksCreated.json" |