Skip to content

Commit

Permalink
#326 Improve testing adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dvoraka committed Jul 10, 2019
1 parent d820405 commit 8817d08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,9 @@ public void send(ReplicationMessage message) {
broker.send(message.getToId(), message);
}
}

@Override
public void onMessage(ReplicationMessage message) {
log.debug("On message ({}): {}", nodeId, message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import dvoraka.avservice.client.transport.test.DefaultSimpleBroker
import dvoraka.avservice.client.transport.test.SimpleBroker
import dvoraka.avservice.client.transport.test.TestingReplicationAdapter
import dvoraka.avservice.common.data.replication.ReplicationMessage
import dvoraka.avservice.common.helper.replication.ReplicationHelper
import spock.lang.Shared
import spock.lang.Specification

class NewReplicationServiceSpec extends Specification {
class NewReplicationServiceSpec extends Specification implements ReplicationHelper {

@Shared
String nodeId1 = "testNode1"
Expand All @@ -33,10 +34,12 @@ class NewReplicationServiceSpec extends Specification {
service1 = new NewReplicationService(component1)

broker.addMessageListener(component1, nodeId1)

broker.addMessageListener(component1, broadcastKey)
}

def "test"() {
expect:
component1
component1.send(createDiscoverRequest(nodeId1))
}
}

0 comments on commit 8817d08

Please sign in to comment.