Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@ class WorkflowResource extends LazyLogging {
@Path("/type/{wid}")
def getWorkflowType(@PathParam("wid") wid: Integer): String = {
val workflow: Workflow = workflowDao.fetchOneByWid(wid)
if (workflow == null) {
throw new NotFoundException(s"Workflow with id $wid not found")
Comment thread
Yicong-Huang marked this conversation as resolved.
}
if (workflow.getIsPublic) {
"Public"
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,12 @@ class WorkflowResourceSpec
assert(sizes.get(wid) == content.length)
}

it should "throw NotFoundException for a missing workflow type" in {
assertThrows[NotFoundException] {
workflowResource.getWorkflowType(Integer.valueOf(2147483647))
}
}

"WorkflowResource.getSize" should "return an empty map for a null or empty id list" in {
assert(workflowResource.getSize(null).isEmpty)
assert(workflowResource.getSize(Collections.emptyList()).isEmpty)
Expand Down
Loading