From the course: API Testing and Validation (2017)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Validate responses

Validate responses

From the course: API Testing and Validation (2017)

Start my 1-month free trial

Validate responses

- [Instructor] Okay, so we've built something useful. That's great, but let's not celebrate yet. After all, it's frustrating to have these incomplete tests down here. If we run them as is, we get back green for the tests we wrote before, and our first one is when I request a list of my repositories. Notice my is still the key thing, because we're talking about an authenticated user. Let's go ahead and start building that up. One thing that we might want to make a change for here is this client and this response are right now local variables. Let's go ahead and make them properties, we'll copy this here to make sure this stays here. In this particular case let's go all the way back to the top, we'll say protected, client, equals null. Just so we have that available to all the further methods in this class. Now we go ahead and we do the authentication, we've got this client we're working with, we can test that yes, this person has authenticated. But now let's do something with it. Say…

Contents