[Hawkular-dev] Mocking HTTP(S) Server

Martin Vecera mvecera at redhat.com
Mon Jun 8 09:17:25 EDT 2015


Hello,

this looks like an elegant solution. One check with Wireshark just to be double-sure would not be bad but it is likely to confirm you are correct ;-)

@M.

----- Original Message -----
From: "Peter Palaga" <ppalaga at redhat.com>
To: "Martin Vecera" <mvecera at redhat.com>, hawkular-dev at lists.jboss.org
Sent: Monday, June 8, 2015 10:25:12 AM
Subject: Re: Mocking HTTP(S) Server

Ahoj Martine, thanks for the info. More inline...

On 2015-06-06 00:04, Martin Vecera wrote:
> Hello Peter,
>
> do you have an idea when did that happen? The site is up and running.
> We do not have any plans to shut it down or do any maintenance mode.
> It might be that the response took too long.

I do not remember if I was getting timeouts or something else.
Nevertheless, a fix based on wiremock is in place now:
https://github.com/hawkular/hawkular/commit/d4d7012f2c68a69d17619aea6a9b49338d427549

> Nevertheless, there was a very good reason why I used this site in
> your unit tests. Every other mock/test site I used was allowed to use
> HTTP as a backup. So even if I asked for HTTPS, if I refused the
> certificate, the test passed. So make sure you update the test to
> check that this is not happening.

If I refuse all certs by returning false here 
https://github.com/hawkular/hawkular/blob/1d8fd2bc06ed3893e4e3bad0c8289838d6bd3e52/modules/pinger/src/main/java/org/hawkular/component/pinger/Pinger.java#L66
the SSL test fails. That is a proof that wiremock is not doing the HTTPS 
fallback to HTTP, is it not?

-- P

> Regards, Martin
>
> P.S.: Please CC me, I am not subscribed to your list.
>
>> Hi *,
>>
>> it happened today: http://perfcake.org/ - one of the sites we
>> unit-test Pinger against is down and therefore the tests are
>> failing.
>>
>> Can anybody recommend a solution for mocking an HTTP Server?
>>
>> http://wiremock.org/ is the first result on Google and I am going
>> to have a look at it.
>>
>> Thanks,
>>
>> Peter
>
>
> -- Martin Večeřa Middleware QE Manager External no. +420 532 294 112
> Internal no. 8262112 IRC: mvecera #brno #jbossqa
>
> Calendar:
> https://www.google.com/calendar/b/1/embed?src=mvecera@redhat.com&ctz=Europe/Prague
>



More information about the hawkular-dev mailing list