Skip to content

Commit

Permalink
Merge pull request #120 from muzzammilshahid/joiner-constructor
Browse files Browse the repository at this point in the history
Make serializer and authenticator optional in Joiner constructor
  • Loading branch information
muzzammilshahid authored Jul 8, 2024
2 parents 15a2444 + 9805a6f commit 4df984b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/src/joiner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final clientRoles = <String, Map<String, Map>>{
};

class Joiner {
Joiner(this._realm, Serializer? serializer, IClientAuthenticator? authenticator)
Joiner(this._realm, {Serializer? serializer, IClientAuthenticator? authenticator})
: _serializer = serializer ?? JSONSerializer(),
_authenticator = authenticator ?? AnonymousAuthenticator("");

Expand Down
4 changes: 2 additions & 2 deletions test/joiner_acceptor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void main() {
var authenticator = Authenticator();
test("AnonymousAuth", () {
var serializer = JSONSerializer();
var joiner = Joiner(realm, serializer, AnonymousAuthenticator(""));
var joiner = Joiner(realm, serializer: serializer, authenticator: AnonymousAuthenticator(""));
var acceptor = Acceptor(serializer: serializer, authenticator: authenticator);

var hello = joiner.sendHello();
Expand Down Expand Up @@ -68,7 +68,7 @@ void main() {

void testAuth(Authenticator authenticator, IClientAuthenticator clientAuthenticator) {
var serializer = JSONSerializer();
var joiner = Joiner(realm, serializer, clientAuthenticator);
var joiner = Joiner(realm, serializer: serializer, authenticator: clientAuthenticator);
var acceptor = Acceptor(serializer: serializer, authenticator: authenticator);

var hello = joiner.sendHello();
Expand Down

0 comments on commit 4df984b

Please sign in to comment.