Skip to content

Commit

Permalink
Create RuleLoaderExceptionTest.groovy
Browse files Browse the repository at this point in the history
Add test coverage for rule loader exceptions
  • Loading branch information
luis-pabon-tf committed Mar 20, 2024
1 parent 4417816 commit 24687f9
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package gov.hhs.cdc.trustedintermediary.etor.ruleengine

import gov.hhs.cdc.trustedintermediary.etor.messages.UnableToSendMessageException
import gov.hhs.cdc.trustedintermediary.wrappers.HttpClientException
import spock.lang.Specification

class RuleLoaderExceptionTest extends Specification {
def "constructor works"() {
given:
def message = "rules loaded wrong!"
def cause = new HttpClientException(message, new IOException())

when:
def exceptionWithCause = new RuleLoaderException(message, cause)
def exceptionWithout = new RuleLoaderException(message)

then:
exceptionWithCause.getMessage() == message
exceptionWithCause.getCause() == cause
exceptionWithout.getMessage() == message
}
}

0 comments on commit 24687f9

Please sign in to comment.