Skip to content

Conversation

@shintasmith
Copy link
Contributor

In standard-usage-schema, I would like to be able to check substring for the 400 message. The reason is, the exact error messages for error 400 returned by Xerces and Saxon are different. I don't want to have to conditionally code this in the standard-usage-schema tests. Instead, I want to be able to check for substring like this:

  test("Slice Action without serviceCode should generate 400 with the appropriate response message") {
    val req = request("POST", "/servers/events", "application/atom+xml", sliceActionWithoutServiceCode)
    val validatorResult = this.assertResultFailed(atomValidator.validate(req, response, chain), 400)
    assert(validatorResult.message.contains("serviceCode"))
    //assertResultFailed(atomValidator.validate(req, response, chain), 400, "Bad Content: Required attribute @serviceCode is missing")
  }

@RackerWilliams
Copy link
Contributor

Like the idea. The only issue I have is that we have a number of variants of the assertResultFailed method and I'd like for there to be some consistency on how they work.

Also we made some changes to the way error results work, so it may make sense to do some further cleanups there too.

I'll have Greg or I have a look at the code to get there to clean up within the next couple of weeks. I'll make sure we keep the form that you want while we do that.

If you want to give a shot at updating the other variants of assertResultFailed go for it.

@shintasmith
Copy link
Contributor Author

I'll take a look into doing this next week.

@RackerWilliams
Copy link
Contributor

Sweet.

Sent from my Motorola Smartphone on the Now Network from Sprint!

-----Original message-----
From: Shinta Smith notifications@github.com
To: InABlender/api-checker api-checker@noreply.github.com
Cc: Jorge Williams jorge.williams@rackspace.com
Sent: Fri, May 3, 2013 08:39:35 CDT
Subject: Re: [api-checker] change assertResultFailed(f : =>, code: Int) to return ErrorResult (#153)

I'll take a look into doing this next week.


Reply to this email directly or view it on GitHubhttps://github.com//pull/153#issuecomment-17394418.

@RackerWilliams
Copy link
Contributor

Hey Shinta,

Do you feel that this is still relevant given that we currently have substring checks?

@shintasmith
Copy link
Contributor Author

Hi, Jorge,
No, I guess I don't need it anymore.

But do you think there's a small merit to making all variant of assertResultFailed returning result? Right now, only one of them does. If not, then you can close this PR.

@RackerWilliams
Copy link
Contributor

Good point, I'll leave the story open. Not a big priority right now, but will get to it when I can.

@RackerWilliams RackerWilliams modified the milestone: Backlog Jun 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants