Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Build a REST API in Spark!
You have completed Build a REST API in Spark!
Preview
Let's take a swing at using Functional Testing of our API. We want to make sure we have status and the correct JSON response.
Code to copy
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
to people who requested features that
things are operating as they expect.
0:00
So what we want to prove here is that
when someone makes a web request to
0:04
a specific URI or resource,
that certain actions happens and
0:09
the correct status codes are returned.
0:13
Right, so that's all we're
testing here functionally.
0:16
Now, what makes things a little hard
here in Spark land is that our routes
0:19
are lambdas as well as they accept
some of these carefully request and
0:23
response objects, right?
0:28
Some frameworks provide a handy
way to perform this testing.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up