Skip to content

mockwebserver does not return set expected responses #5422

@sandy-sandeeep

Description

@sandy-sandeeep

Describe the bug

server.expect()
.post()
.withPath("somepath")
.andReturn("400", "message")
.once();

is returning 400 and the message that is set

server.expect()
.post()
.withPath("somepath")
.andReturn("420", "message")
.once();

is also behaving the way it is expected.

But when I try to add expectations for 429, 500 and 100. I am not getting the expected response instead getting 404 with message : Not Found.

I have tested this in the same test that is working for above to 400 and 420... No logic is changed but behavior is changing for other error codes

Fabric8 Kubernetes Client version

other (please specify in additional context)

Steps to reproduce

In any of your existing functional test for post on mockwebserver change the return code to 429 and see if you are getting the expected rsponse if you run the test.

Expected behavior

you should receive the mentioned error code and message that is set in the expectation

Runtime

other (please specify in additional context)

Kubernetes API Server version

other (please specify in additional context)

Environment

macOS

Fabric8 Kubernetes Client Logs

No response

Additional context

I am using fabric8.version 6.7.0 for kubernetes-client kubernetes-server-mock also 6.7.0

Metadata

Metadata

Assignees

Labels

Waiting on feedbackIssues that require feedback from User/Other community members

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions