@@ -75,7 +75,6 @@ public void emptyReturnsEmptyDittoHeaders() {
75
75
76
76
DittoBaseAssertions .assertThat (dittoHeaders )
77
77
.hasNoCorrelationId ()
78
- .hasNoSchemaVersion ()
79
78
.hasNoAuthorizationSubjects ()
80
79
.hasNoReadGrantedSubjects ();
81
80
}
@@ -94,15 +93,6 @@ public void tryToSetEmptyCorrelationId() {
94
93
underTest .correlationId ("" );
95
94
}
96
95
97
- @ Test
98
- public void setNullSchemaVersionRemovesSchemaVersion () {
99
- underTest .schemaVersion (JSON_SCHEMA_VERSION );
100
- underTest .schemaVersion (null );
101
- final DittoHeaders dittoHeaders = underTest .build ();
102
-
103
- assertThat (dittoHeaders .getSchemaVersion ()).isEmpty ();
104
- }
105
-
106
96
@ Test
107
97
public void buildReturnsExpected () {
108
98
final DittoHeaders dittoHeaders = underTest .correlationId (CORRELATION_ID )
@@ -175,17 +165,6 @@ public void jsonRepresentationOfDittoHeadersWithCorrelationIdOnlyIsExpected() {
175
165
.contains (JsonFactory .newKey (DittoHeaderDefinition .CORRELATION_ID .getKey ()), CORRELATION_ID );
176
166
}
177
167
178
- @ Test
179
- public void jsonRepresentationOfDittoHeadersWithSchemaVersionOnlyIsExpected () {
180
- final DittoHeaders dittoHeaders = underTest .schemaVersion (JSON_SCHEMA_VERSION ).build ();
181
- final JsonObject jsonObject = dittoHeaders .toJson ();
182
-
183
- assertThat (jsonObject )
184
- .hasSize (1 )
185
- .contains (JsonFactory .newKey (DittoHeaderDefinition .SCHEMA_VERSION .getKey ()),
186
- JsonFactory .newValue (JSON_SCHEMA_VERSION .toInt ()));
187
- }
188
-
189
168
@ Test
190
169
public void jsonRepresentationOfDittoHeadersWithChannelOnlyIsExpected () {
191
170
final DittoHeaders dittoHeaders = underTest .channel (CHANNEL ).build ();
@@ -260,7 +239,7 @@ public void tryToCreateInstanceWithMapContainingInvalidHeader() {
260
239
261
240
@ Test
262
241
public void tryToCreateInstanceWithJsonObjectContainingInvalidHeader () {
263
- final String schemaVersionKey = DittoHeaderDefinition .SCHEMA_VERSION .getKey ();
242
+ final String schemaVersionKey = DittoHeaderDefinition .RESPONSE_REQUIRED .getKey ();
264
243
final String invalidSchemaVersionValue = "meh" ;
265
244
266
245
final JsonObject headersJsonObject = JsonFactory .newObjectBuilder ()
@@ -271,7 +250,7 @@ public void tryToCreateInstanceWithJsonObjectContainingInvalidHeader() {
271
250
272
251
assertThatExceptionOfType (DittoHeaderInvalidException .class )
273
252
.isThrownBy (() -> of (headersJsonObject ))
274
- .withMessage ("The value '%s' of the header '%s' is not a valid int ." , invalidSchemaVersionValue ,
253
+ .withMessage ("The value '%s' of the header '%s' is not a valid boolean ." , invalidSchemaVersionValue ,
275
254
schemaVersionKey )
276
255
.withNoCause ();
277
256
}
@@ -304,7 +283,7 @@ public void removePreconditionHeaders() {
304
283
305
284
@ Test
306
285
public void tryToPutMapWithInvalidMessageHeader () {
307
- final String key = DittoHeaderDefinition .SCHEMA_VERSION .getKey ();
286
+ final String key = DittoHeaderDefinition .RESPONSE_REQUIRED .getKey ();
308
287
final String invalidValue = "bar" ;
309
288
310
289
final Map <String , String > invalidHeaders = new HashMap <>();
@@ -313,7 +292,7 @@ public void tryToPutMapWithInvalidMessageHeader() {
313
292
314
293
assertThatExceptionOfType (DittoHeaderInvalidException .class )
315
294
.isThrownBy (() -> underTest .putHeaders (invalidHeaders ))
316
- .withMessage ("The value '%s' of the header '%s' is not a valid int ." , invalidValue , key )
295
+ .withMessage ("The value '%s' of the header '%s' is not a valid boolean ." , invalidValue , key )
317
296
.withNoCause ();
318
297
}
319
298
0 commit comments