-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#225 Improve tests and implementation
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 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
42 changes: 42 additions & 0 deletions
42
...c/test/groovy/dvoraka/avservice/client/service/response/ReplicationMessageListSpec.groovy
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,42 @@ | ||
package dvoraka.avservice.client.service.response | ||
|
||
import dvoraka.avservice.common.replication.ReplicationHelper | ||
import spock.lang.Specification | ||
import spock.lang.Subject | ||
|
||
/** | ||
* List spec. | ||
*/ | ||
class ReplicationMessageListSpec extends Specification implements ReplicationHelper { | ||
|
||
@Subject | ||
ReplicationMessageList messages | ||
|
||
|
||
def setup() { | ||
messages = new ReplicationMessageList() | ||
} | ||
|
||
def "add message"() { | ||
expect: | ||
messages.size() == 0 | ||
|
||
when: | ||
messages.add(createDiscoverRequest('node ID')) | ||
|
||
then: | ||
messages.size() == 1 | ||
} | ||
|
||
def "get stream"() { | ||
expect: | ||
messages.size() == 0 | ||
|
||
when: | ||
messages.add(createDiscoverRequest('node ID')) | ||
messages.add(createDiscoverRequest('node ID')) | ||
|
||
then: | ||
messages.stream().count() == 2 | ||
} | ||
} |