-
Notifications
You must be signed in to change notification settings - Fork 16
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
Added Insert One and Create Collection commands #16
Conversation
# Conflicts: # src/main/java/io/stargate/sgv3/docsapi/exception/ErrorCode.java # src/main/java/io/stargate/sgv3/docsapi/service/shredding/Shredder.java # src/main/java/io/stargate/sgv3/docsapi/service/shredding/model/WritableShreddedDocument.java
/gcbrun |
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.
I just realized after reviewing this that it's already merged..
I am quite shocked that there was an approving review on a PR with almost 1K code changes without any comment @tatu-at-datastax ? And I just pushed 27 of them.. This is not how we can work together, sorry but it's not point of review to get approval so it can be merged asap..
It's also not fair that I am kicking my ass out to review everything in details, it takes a lot of energy and time and I expect same from the whole team..
I expect that all of my comments are addressed in a followup PR.
INSERTED_IDS; | ||
INSERTED_IDS, | ||
@JsonProperty("ok") | ||
CREATE_COLLECTION; |
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.
why is this not called OK
?
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.
As per MongoDB documentation createCollection returns response as { "ok" : 1 }
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.
No, I meant why is enum not called OK
😄
implementation = Object.class, | ||
type = SchemaType.OBJECT) |
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.
not needed would be automatically worked out
.when() | ||
.post(CollectionResource.BASE_PATH, keyspaceId.asInternal(), collectionName) | ||
.then() | ||
.statusCode(200); |
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.
Everything returns 200, we must be more detailed:
body("status.insertedIds[0]", is("doc1"))
@@ -56,6 +83,29 @@ public void happyPath() { | |||
|
|||
@Nested | |||
class InsertOne { | |||
@Test | |||
public void insertDocument() { |
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 add insert multiple documents
@Test | ||
public final void createCollection() { | ||
String json = | ||
String.format( | ||
""" | ||
{ | ||
"createCollection": { | ||
"name": "%s" | ||
} | ||
} | ||
""", | ||
collectionName); | ||
given() | ||
.header(HttpConstants.AUTHENTICATION_TOKEN_HEADER_NAME, getAuthToken()) | ||
.contentType(ContentType.JSON) | ||
.body(json) | ||
.when() | ||
.post(DatabaseResource.BASE_PATH, keyspaceId.asInternal()) | ||
.then() | ||
.statusCode(200); | ||
} |
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.
what's this? if the collection does not exists it should be created by the insertOne.. This now makes test pass only with actually executing this first, which is not even guaranteed with this setup
No description provided.