-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: STREAMP-12336: removing validation on schema key if it's changing in update request #361
Changes from all commits
0fa4562
f68a4ef
805bb92
8e3208a
04d8a20
757714b
4fb1fd4
83741c3
638aea7
fc1d933
0821e3c
867672f
9cb5112
f9a5703
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
* Copyright (C) 2018-2021 Expedia, Inc. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are changes to this file still necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah because now, we have check if schema is not matching with existing schemaKey. |
||
* Copyright (C) 2018-2024 Expedia, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -70,15 +70,16 @@ public void update() { | |
|
||
@Override | ||
public void upsert() { | ||
|
||
try { | ||
client.getOptionalData(factory.upsertStreamMutationBuilder() | ||
.schema(null) | ||
.build()).get(); | ||
} catch (RuntimeException ex) { | ||
assertEquals("Schema does not exist", ex.getMessage()); | ||
} | ||
|
||
/** | ||
* Not throw exception, because we are over-riding schemaKey if schemaKey is null | ||
*/ | ||
client.getOptionalData(factory.upsertStreamMutationBuilder() | ||
.schema(null) | ||
.build()).get(); | ||
|
||
/** | ||
* This should throw exception if schemaKey is matches with the existing schemaKey. | ||
*/ | ||
try { | ||
SchemaKeyInput nonExisting = SchemaKeyInput.builder() | ||
.domain(factory.domainName) | ||
|
@@ -87,8 +88,8 @@ public void upsert() { | |
client.getOptionalData(factory.upsertStreamMutationBuilder() | ||
.schema(nonExisting) | ||
.build()).get(); | ||
} catch (RuntimeException ex) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing this validation from egsp-stream-reg for update case. |
||
assertEquals("Schema does not exist", ex.getMessage()); | ||
} catch(RuntimeException ex ) { | ||
assertTrue(ex.getMessage().contains("update failed, because existing schemaKey")); | ||
} | ||
|
||
Object data = client.getOptionalData(factory.upsertStreamMutationBuilder().build()).get(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we validate the output contains the non null schemakey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added