• English
  • Deutsch
  • Русский
Syndicate content

Dynamic extensions for WireMock

WireMock is a simulator for HTTP-based APIs. It can be used as a standalone server to retrieve the static JSON responses. This can be done very easy - just add a JSON file in Wiremock server and configure mapping to match the request. However, these static responses are not practical in some cases and a certain mechanism is needed to return the responses dynamically. The good news is that this mechanism exists in WireMock and it provides the dynamically transformed output. In order to get that done, java class should be implemented with transformation logic and registered as an extension from the command line. It would be acceptable when response is simple so that data structure in response is not very hierarchical, otherwise it would be needed to spent time to implement this code that performs all this transformation with allowance made for expected complex response. Owing to the fact that WireMock supports also response templating, it can be simplified via Handlebars templates.

As example, assume that this response is a response from Kubernetes API, i.e. reading information about the specified Pods. This response in itself has complex hierarchy, you can look at Kubernete's OpenAPI Specification to imagine all this structure. Implementation of java code to generate the response would be not trivial task, but via Handlebars templates the response from real Kubernetes service can be stored in JSON file and updated with Handlebars expressions to inject the dynamic values at runtime.


In addition to leader experience, not always, but nevertheless it is necessary to talk with psychologists. The special relation to the representatives of this profession was formed to me. I don’t know, whether I have so luck, whether it is still something, but they feel practically always as sovereign of another’s destinies. It looks especially strange when a psychologist is not experienced, but he is already a sovereign.

I will not disguise, an advice from psychologist is necessary sometimes. At least as it is a sight from the side.

There was a case in my practice when I consulted a psychologist and not regretted. I am grateful till now to this person for help.

Two employees were grappled together. They made something average between fight and rough discussion, and it lasted all about one week. Here, they were coming at work every day and were finding actively who is right. Any sleight of hand can’t help to stop this process. The situation isn’t pleasant at least. It is strange, but I didn’t expect this from these people.

The psychologist has estimated this event as an element of show. The first of all it is necessary to cease to pay an attention to them. I was shocked. She has asked – “Do they carry out a volume of work? Does somebody from others participate in this?”. It is enough strange, but they handled own job well. Anyone from the colleagues didn’t interfere in this dispute; all had the time troubles and no time for that. Certainly, when somebody tried to comment and take the part of someone’s, the situation was aggravated. After I ceased to “separate” and listen of them, it was visible that they tired seriously from each other, and then they kept silent.

Well, I could not assume that the programmers wanted to arrange a show. Yes, and it was not similar to entertainment. In general, now I remember – it is funny and at that time it was somehow not so.

Leader experience

Here is three years, when I am grinding my leadership qualities without being noticed. Since I don’t want categorically to perform the experiments over the people and don’t want to be willfully despotic at the work place, I should to read periodically the literature about it, to go on specialized trainings and the most important – to observe another leaders and not only from IT area.

Here is my summary: there are two categories of workers – “People of Possibility” – who can think and make a decision independently. As rule, they are motivated without assistance. The second category is “People of procedure” – they should become the concrete tasks and due dates. They are excellent executors. I can exactly say that a team has to have “Possibility” both “Procedure” share and share alike. The team will have the real success only by this way. Wherever “Possibility”-people think and discuss as well as suggest the new ideas, the “Procedure”-people perform the functions.

The second conclusion – it is necessary to motivate the people. The bonus system must be clear and reliable.

Here is still not the least of the factors: to detect the individuals and to have time to direct their peculiarities in right direction. For example, I have worked once with one party that was not professional technical guru. However, he is that person, who can lead absolutely all people. I think that it is a rare quality, which is given at birth, as rule, and it is necessary to use it at full scale.

I am all for giving a possibility for students to obtain experience, but not to reject and ignore them. I make no secret of the fact that I concluded this not too long ago. Yes, it is inconvenient. Yes, it takes a lot of time and strengths. I can say only – I have three striking examples, when people don’t work by now with me unfortunately, but they don’t forget and advise to me. I think that it will assume ever greater importance for me when I will 50 years old, even greater than now.

It is necessary to supervise the people that want something to change. It is good, when the people around of you, are gathered not indifferent. However, such people can be among them, who don’t understand that “Organism” breathes already and it must be strengthened, but not do so in order to destroy it.

Certainly, there are not all my conclusions and observations. I will extend obligatory this subject further.

Keen vision

We are people, who spend a lot of time in front of computer and bear a strong resemblance to “stern eagles”. It is honestly. I observed more than once colleagues, and I am even. All screw up their eyes. For example, it is easier for me to work instead of winking as the ophthalmologists propose with some frequency. Such exercise doesn’t allow me to have a possibility to concentrate; therefore it is simpler to pose as “stern” look.

I tried several times to solve the question about sight, because the load is rather big on this organ. I think that the prophylaxis is necessary!

I refused immediately the pills that are offered in big amount at our market. Although I ordered somehow the vitamins from Germany, it is still better there with this. Certainly, it was an effect – the eyes are tired not so from the artificial lighting.

I am reading periodically the information on this topic. The natural ways are of interest to me yet, for example, strengthening of sight with help of healthy food stuffs. That is what I tried personally.

Well-known carrot juice is for devotees. The most important thing in a glass of carrot fresh is a beta carotene which eliminates the dryness in eyes. As I observed, it is necessary to drink it not less than one month in order to have a result.

Usual parsley is not bad alternative, but I refused immediately from parsley’s fresh. I don’t know what to do in order to squeeze juice out of grass. However, if to use the warm time of year and not hothouse greens then sight can be restored exactly.

Bilberry is an excellent help for sight. However the topics about measurement of radiation level in these berries are confused and I think: buy or not buy. And generally, there is a positive effect. Be careful! Teeth are black after bilberry, so it is better to do the cocktails and drink through a straw.


I am assembling long ago the different opinions about freelancer’s work. I like the point of view not only from programmers, but also from designers, copywriters, etc.
Somebody says that it is not comfortable to work at home. There are own disadvantages, all talk about them indeed: in most cases you are your own accountant and it is a responsibility. There is still such a thing: stuff today and starve tomorrow. Nobody pays for vacation and medical treatment, and it looks strange in my opinion as times go. Though there is something in it.

I have freelancers among my familiars, who work nights exclusive and not only with USA. A possibility to work independently for such people is really salutary. There are too few employers at least, who can estimate their abilities, which are activated only in the nighttime.

I was working all last week at home. I understood already long ago that it is better for me to work at own walls. Somebody says that the down-home atmosphere damps the ardor. It is good, that I don’t feel it totally. My wife understand excellently, when I am busy really and she doesn’t prevent me. She has even learned to sleep when I am typing on keyboard. Moreover, when somebody phones me, she can answer that I am busy and will call back later. I like it plenty!

In spite of these benefits, I have time to do a lot of things and more than in office.

Most likely, all depends on the inner world. It is banal, but it is really so. Therefore I would like to wish all teleworkers, may success attend you! It is necessary also in own walls: in order not to twist off the tap, in order not to be ill the children; if you have the violent neighbors, let they show themselves seldom, and better, if they don’t show themselves totally, let they drill never and use bad language never. And let it be the electricity at your home, it is also very important.

Copyright 2008-2017, pererva production