IntegrationTest_SystemSchema_PUT.feature 11.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Feature: To verify functionality of PUT schema Service

  ### Commons test steps are accomplished here
  Background: Common steps for all tests are executed
    Given I generate user token and set request headers for "TENANT1"
    Given I get latest schema with authority, source, entityType as "SchemaSanityTest", "testSource", "testEntity" respectively
    Given I generate user token and set request headers for system API
    Given I hit system schema PUT API with "/input_payloads/postInPrivateScope_positiveScenario.json" only if status is not development

  @SchemaService
  Scenario Outline: Verify that System schema PUT API works correctly without scope field
    Given I hit system schema PUT API with <InputPayload>
    Then put schema service should respond back with <ReponseStatusCodeForPUT>
    Given I set request headers for "TENANT1"
    And schema service should respond back with <ReponseStatusCodeForGET> and <ResponseMessageforGET>

    Examples:
      | InputPayload                                                | ReponseStatusCodeForPUT | ReponseStatusCodeForGET | ResponseMessageforGET                  |
      | "/input_payloads/postInPrivateScope_positiveScenario.json"  | "200"                   | "200"                   | "/output_payloads/ResolvedSchema.json" |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API works correctly and update schema properly
    Given I hit system schema PUT API with <InputPayload>
    And put schema service should respond back with <ReponseStatusCodeForPUT>
    When I hit system schema PUT API with <UpdatedInputPayload>
    Then put schema service should respond back with <ReponseStatusCodeForPUT>
    Given I set request headers for "TENANT1"
    And schema service should respond back with <ReponseStatusCodeForGET> and <ResponseMessageforGET>

    Examples:
      | InputPayload                                                | ReponseStatusCodeForPUT | ReponseStatusCodeForGET | ResponseMessageforGET                         | UpdatedInputPayload                                      |
      | "/input_payloads/postInPrivateScope_positiveScenario.json"  | "200"                   | "200"                   | "/output_payloads/UpdatedResolvedSchema.json" | "/input_payloads/putUpdatedSchema_positiveScenario.json" |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API throws error if put request tries to create new record without development status
    Given I hit system schema PUT API with <InputPayload> and mark schema as <status> for next major version
Akshat  Joshi's avatar
Akshat Joshi committed
37
    Then service should respond back with <ReponseStatusCode> and <ResponseMessage>
38
39

    Examples:
Akshat  Joshi's avatar
Akshat Joshi committed
40
      | InputPayload                                                | ReponseStatusCode | ResponseMessage                                                    | status      |
Akshat  Joshi's avatar
Akshat Joshi committed
41
42
      | "/input_payloads/postInPrivateScope_positiveScenario.json"  | "201"             | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "OBSOLETE"  |
      | "/input_payloads/postInPrivateScope_positiveScenario.json"  | "201"             | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "PUBLISHED" |
43
44

  @SchemaService
Akshat  Joshi's avatar
Akshat Joshi committed
45
  Scenario Outline: Verify that System schema PUT API throws error if modification in schemaInfo is requested
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
    Given I hit system schema PUT API with <InputPayload> with different entityType
    Then put schema service should respond back with <ReponseStatusCodeForPUT>
    Given I set request headers for "TENANT1"
    And schema service should respond back with <ReponseStatusCodeForGET> and <ResponseMessageforGET>

    Examples:
      | InputPayload                                 | ReponseStatusCodeForPUT | ReponseStatusCodeForGET | ResponseMessageforGET                  |
      | "/input_payloads/PUT_ModifySchemaInfo.json"  | "201"                   | "200"                   | "/output_payloads/UpdatedSchema_EntityTypeUpdate.json" |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API validates input payload
    Given I hit system schema PUT API with <InputPayload>
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                             | ReponseStatusCode | ResponseMessage                                       |
      | "/input_payloads/inputPayloadWithIncorrectJSON.json"  | "400"             | "/output_payloads/SchemaPost_IncorrectJsonError.json" |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API responds as bad request for wrong value of $ref attribute in schema input
    Given I hit system schema PUT API with <InputPayload>
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                                 | ReponseStatusCode | ResponseMessage                                           |
      | "/input_payloads/postSchema_InvalidRefSchemaObject.json"  | "400"             | "/output_payloads/PostSchema_InvalidRefSchemaObject.json" |
      | "/input_payloads/postSchema_RefNotResolvable.json"        | "400"             | "/output_payloads/PostSchema_RefNotResolvable.json"       |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API responds as bad request for wrong value of $ref attribute in schema input
    Given I hit system schema PUT API with <InputPayload> with next major version
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                                 | ReponseStatusCode | ResponseMessage                                           |
      | "/input_payloads/postSchema_InvalidRefSchemaObject.json"  | "400"             | "/output_payloads/PostSchema_InvalidRefSchemaObject.json" |
      | "/input_payloads/postSchema_RefNotResolvable.json"        | "400"             | "/output_payloads/PostSchema_RefNotResolvable.json"       |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API validates input payload for JSON correctness
    Given I hit system schema PUT API with <InputPayload>
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                         | ReponseStatusCode | ResponseMessage                                           |
      | "/input_payloads/inputPayloadWithIncorrectJSON.json" | "400"             | "/output_payloads/SchemaPost_IncorrectJsonError.json"  |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API validates input payload for JSON correctness
    Given I hit system schema PUT API with <InputPayload> with next major version
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                         | ReponseStatusCode | ResponseMessage                                           |
      | "/input_payloads/inputPayloadWithIncorrectJSON.json" | "400"             | "/output_payloads/SchemaPost_IncorrectJsonError.json"  |

  #@SchemaService Commenting this tag for now since this scenario for "common" is failing
  Scenario Outline: Verify that System schema PUT API registers authority, source, entity and creates a private schema correctly with $ref attribute
    Given I hit system schema PUT API with <InputPayload>
    Then service should respond back with <ReponseStatusCode> and <ResponseMessage> and scope whould be <responceScope>

    Examples:
      | InputPayload                                                         | ReponseStatusCode | ResponseMessage                                                    | responceScope |
      | "/input_payloads/postSchemaServiceWithRef_positiveScenario.json"  | "200"             | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "INTERNAL"    |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API registers authority, source, entity and creates a private schema correctly with $ref attribute
    Given I hit system schema PUT API with <InputPayload> with next major version
    Then service should respond back with <ReponseStatusCode> and <ResponseMessage> and scope whould be <responceScope>

    Examples:
      | parameter   | value              | latestVersion | InputPayload                                                         | otherTenant | ReponseStatusCode | ResponseMessage                                                    | responceScope |
      | "authority" | "OSDUTest" | "true"        | "/input_payloads/postSchemaServiceWithRef_positiveScenario.json"  | "COMMON"    | "201"             | "/output_payloads/SchemaPost_PrivateScope_SuccessfulCreation.json" | "INTERNAL"    |

  @SchemaService
  Scenario Outline: Verify that create Schema Service supersededBy functionality work correctly
    Given I hit system schema PUT API for supersededBy with <InputPayload>
    Then the put service for supersededBy should respond back with <ReponseStatusCode>

    Examples:
      | InputPayload                                               | ReponseStatusCode |
      | "/input_payloads/supercededInputPayload_positive.json"  | "201"             |

  @SchemaService
  Scenario Outline: Verify that update Schema Service supersededBy functionality work correctly
    Given I set request headers for "TENANT1"
    Given I get latest schema with authority, source, entityType as "SchemaSanityTest", "testSource", "testEntity" respectively
    Given I hit system schema PUT API with <InputPayload> for superceded input
    Then the put service for supersededBy should respond back with <ReponseStatusCode>

    Examples:
      | InputPayload                                             | ReponseStatusCode |
      | "/input_payloads/postSchemaService_EmptySchema.json"  | "200"             |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API throws correct error if input payload is not valid
    Given I hit system schema PUT API with <InputPayload>
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                                       | ReponseStatusCode | ResponseMessage                                            |
      | "/input_payloads/postSchema_withEntityAttributeInPayload.json"  | "400"             | "/output_payloads/PostSchema_EntityNotAllowedError.json"   |
      | "/input_payloads/postSchema_flattenedSchemaAsInput.json"        | "400"             | "/output_payloads/PostSchema_InvalidInputSchemaError.json" |

  @SchemaService
  Scenario Outline: Verify that System schema PUT API throws correct error if input payload is not valid
    Given I hit system schema PUT API with <InputPayload>
    Then service should respond back with error <ReponseStatusCode> and <ResponseMessage>

    Examples:
      | InputPayload                                                       | ReponseStatusCode | ResponseMessage                                            |
      | "/input_payloads/postSchema_withEntityAttributeInPayload.json"  | "400"             | "/output_payloads/PostSchema_EntityNotAllowedError.json"   |
      | "/input_payloads/postSchema_flattenedSchemaAsInput.json"        | "400"             | "/output_payloads/PostSchema_InvalidInputSchemaError.json" |