Skip to content

Commit 59488ff

Browse files
author
Jeff Bornemann
committed
Coverage for failing scenario in 61c3b
1 parent 61c3b91 commit 59488ff

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/test/groovy/com/twcable/grabbit/client/batch/steps/validation/ValidJobDeciderSpec.groovy

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,19 @@ class ValidJobDeciderSpec extends Specification {
7979
jobDecider.decide(jobExecution, stepExecution) == ValidJobDecider.JOB_INVALID
8080
}
8181

82-
def "Will pass validation if paths with an existent parent are submitted"(){
82+
@Unroll
83+
def "Will pass validation if paths with an existent parent are submitted, path: #path for parent path #parentPath"(){
8384
when:
8485
final JobExecution jobExecution = Mock(JobExecution) {
8586
getJobParameters() >> {
8687
return Mock(JobParameters) {
87-
getString(ClientBatchJob.PATH) >> "/foo/bar"
88+
getString(ClientBatchJob.PATH) >> path
8889
}
8990
}
9091
}
9192
final Session session = Mock(Session) {
92-
getNode("/foo") >> { return Mock(Node) }
93+
getNode(parentPath) >> { return Mock(Node) }
94+
getNode(_) >> { throw new PathNotFoundException()}
9395
}
9496

9597
ClientBatchJobContext.setSession(session)
@@ -99,6 +101,12 @@ class ValidJobDeciderSpec extends Specification {
99101

100102
then:
101103
jobDecider.decide(jobExecution, stepExecution) == ValidJobDecider.JOB_VALID
104+
105+
where:
106+
parentPath | path
107+
'/foo' | '/foo/bar'
108+
'/foo' | '/foo/fo'
109+
'/foo' | '/foo/fo/'
102110
}
103111

104112
def "Recovers gracefully if an issue is encountered with the repository"() {

0 commit comments

Comments
 (0)