-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: WriteAcknowledgement API (#882) * refactor: WriteAcknowledgement takes exported.Acknowledgement instead of bytes * fix: adding check for empty byte string * chore: update changelog * fixing test case + adding migration docs * testing: Adding MockEmptyAcknowledgement to testing library * docs: fix version * test: add check for ack is nil (cherry picked from commit acbc9b6) # Conflicts: # CHANGELOG.md * fix changelog merge conflict * backport migration docs Co-authored-by: Sean King <seantking@users.noreply.github.com> Co-authored-by: Colin Axnér <25233464+colin-axner@users.noreply.github.com>
- Loading branch information
1 parent
f68514c
commit 5534418
Showing
8 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package mock | ||
|
||
// MockEmptyAcknowledgement implements the exported.Acknowledgement interface and always returns an empty byte string as Response | ||
type MockEmptyAcknowledgement struct { | ||
Response []byte | ||
} | ||
|
||
// NewMockEmptyAcknowledgement returns a new instance of MockEmptyAcknowledgement | ||
func NewMockEmptyAcknowledgement() MockEmptyAcknowledgement { | ||
return MockEmptyAcknowledgement{ | ||
Response: []byte{}, | ||
} | ||
} | ||
|
||
// Success implements the Acknowledgement interface | ||
func (ack MockEmptyAcknowledgement) Success() bool { | ||
return true | ||
} | ||
|
||
// Acknowledgement implements the Acknowledgement interface | ||
func (ack MockEmptyAcknowledgement) Acknowledgement() []byte { | ||
return []byte{} | ||
} |