Skip to content

Commit

Permalink
GODRIVER-2075 Update "mtest.T.Get*Event()" documentation (#1407)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramitmittal authored Oct 3, 2023
1 parent cd3c699 commit d6ed7ca
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions mongo/integration/mtest/mongotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,9 @@ func (t *T) ClearMockResponses() {
t.mockDeployment.clearResponses()
}

// GetStartedEvent returns the most recent CommandStartedEvent, or nil if one is not present.
// GetStartedEvent returns the least recent CommandStartedEvent, or nil if one is not present.
// This can only be called once per event.
func (t *T) GetStartedEvent() *event.CommandStartedEvent {
// TODO(GODRIVER-2075): GetStartedEvent documents that it returns the most recent event, but actually returns the first
// TODO event. Update either the documentation or implementation.
if len(t.started) == 0 {
return nil
}
Expand All @@ -291,11 +289,9 @@ func (t *T) GetStartedEvent() *event.CommandStartedEvent {
return e
}

// GetSucceededEvent returns the most recent CommandSucceededEvent, or nil if one is not present.
// GetSucceededEvent returns the least recent CommandSucceededEvent, or nil if one is not present.
// This can only be called once per event.
func (t *T) GetSucceededEvent() *event.CommandSucceededEvent {
// TODO(GODRIVER-2075): GetSucceededEvent documents that it returns the most recent event, but actually returns the
// TODO first event. Update either the documentation or implementation.
if len(t.succeeded) == 0 {
return nil
}
Expand All @@ -304,11 +300,9 @@ func (t *T) GetSucceededEvent() *event.CommandSucceededEvent {
return e
}

// GetFailedEvent returns the most recent CommandFailedEvent, or nil if one is not present.
// GetFailedEvent returns the least recent CommandFailedEvent, or nil if one is not present.
// This can only be called once per event.
func (t *T) GetFailedEvent() *event.CommandFailedEvent {
// TODO(GODRIVER-2075): GetFailedEvent documents that it returns the most recent event, but actually returns the first
// TODO event. Update either the documentation or implementation.
if len(t.failed) == 0 {
return nil
}
Expand Down

0 comments on commit d6ed7ca

Please sign in to comment.