-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
67 additions
and
44 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
45 changes: 45 additions & 0 deletions
45
beacon/core/src/test/groovy/edu/internet2/tap/beacon/DefaultBeaconPublisherTests.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,45 @@ | ||
package edu.internet2.tap.beacon | ||
|
||
import spock.lang.Specification | ||
import sun.security.x509.OtherName | ||
|
||
class DefaultBeaconPublisherTests extends Specification { | ||
|
||
def "DefaultBeaconPublisher invariants are enforced during object creation - null Map is passed"() { | ||
when: | ||
new DefaultBeaconPublisher(null) | ||
|
||
then: | ||
thrown IllegalArgumentException | ||
|
||
} | ||
|
||
def "DefaultBeaconPublisher invariants are enforced during object creation - empty Map is passed"() { | ||
when: | ||
new DefaultBeaconPublisher([:]) | ||
|
||
then: | ||
thrown IllegalArgumentException | ||
} | ||
|
||
def "DefaultBeaconPublisher invariants are enforced during object creation - valid Beacon data Map is passed"() { | ||
when: | ||
def expectedJsonPaylaod = """{"msgType":"TIERBEACON", "tbMaintainer":"unittest_maintainer", "msgName":"TIER", "tbProduct":"image", "msgVersion":"1.0", "tbProductVersion":"v1", "tbTIERRelease":"tv1"}""" | ||
|
||
def configuredBeaconData = [LOGHOST : 'collector.testbed.tier.internet2.edu', | ||
LOGPORT : '5001', | ||
IMAGE : 'image', | ||
VERSION : 'v1', | ||
TIERVERSION: 'tv1', | ||
MAINTAINER : 'unittest_maintainer'] | ||
def p = new DefaultBeaconPublisher(configuredBeaconData) | ||
println p.jsonPayload | ||
|
||
then: | ||
noExceptionThrown() | ||
p.endpointUri == 'http://collector.testbed.tier.internet2.edu:5001' | ||
p.jsonPayload == expectedJsonPaylaod | ||
|
||
} | ||
|
||
} |
39 changes: 0 additions & 39 deletions
39
beacon/core/src/test/java/edu/internet2/tap/beacon/DefaultBeaconPublisherTests.java
This file was deleted.
Oops, something went wrong.