 So thank you very much. I hope the session goes well, because today everything that could have happened happened. So I actually had to redo the entire presentation, but it's OK. I mean, we are good to go, so I'm happy about that. So let's start with the presentation. And yes, framework agnostic REST API testing. And the title actually said only testing, but I'm also going to add the development. A little bit about me. You can hear a different accent. That's because I'm from Mexico. I live in Switzerland. I work for a company called Carcune, and I'm a Java champion. And this photo actually summarized what I like to do. I like to travel or use to travel a lot around the world. Conferences or conferences, in this case, this was Jane Crete. So that's something I really, really like to do. When I create an assertion, there are several motivations for why I want to present something. And most of the times is because I'm formed of some tools. And we are developers, so we are as good as our tools are. And not only that, we can learn new tools. But how proficient we are, it's going to be decisive on how fast, how good can we deliver, or even enjoying the development process. So these are the tools I'm going to present. Yes, I usually do this session with test containers. And I will describe why, because that's also one of my most favorite tools ever. In this case, it's only going to be Wiremock. And you will notice that that's also one of the tools that I have closer to my heart. That's just sure. I'm going to talk about Open API and a little bit of Swagger. So and some interesting thing to notice. I only or most of the time, I talked about open source software, because I think open source is really, really important for all of us. So as I said, the tools that I'm going to present, they are brilliant for REST APIs. Not only that, and you will see why I also in love with these tools, because they are polyphasetic. Well, in case of Wiremock, it's very polyphasetic. The orders are totally only brilliant in the REST API world. So why am I doing this? Why REST APIs? I mean, there are so many incredible topics that we can be leveraging right now. Why REST APIs? Well, as we have seen, we have gone into the micro serverless function different versions. So it is important that we notice that even though it's not the only way of communication, REST APIs are very typical. And we will see them in most places. And this is something interesting. The REST APIs can be consumed internally and externally, or they can be public. For example, in this site that I found, there are several ones that are repositories or catalogs of public available REST APIs. They are cataloging almost 24,000 REST APIs. So they are there. We're going to work with them. There are several solutions. For example, if you are in the AWS environment, there are some already infrastructure, the API gateway, their own testing capabilities. But remember what I said in the title, I wanted to have something that is agnostic. As I said to you, this is the second time I'm creating the slides. So there was a huge bunch of slides about why you are not using other tools. For example, Pact, for example, a Spring has its own set of tools for creating the REST API and by contract. Well, I'm comparing versions. I'm comparing maturity. I'm comparing. And the most important part is still agnostic. It is still, for example, for Pact. It's easy if you want to create consumer-driven contract tests. If you have your Pact file, you can distribute it among your development teams. And that is perfect. But what is the assumption here? The assumption is that everybody is using Pact. Now, when we talked about microservices, we already said they are loosely coupled. We don't have any knowledge about the services. And that's OK. But that's also something that we have to think about of the development teams. Sometimes we don't know what they are using for documenting. Sometimes we cannot assume things. So for me, using OpenAPI and WireMock, it's good. And you will see why it's amazing. But let's say conservatively, it's good because I'm not using or I'm not doing any assumptions. The next topic that I really want to talk on most of my sessions have something like this. It's about design. And why do I talk about design? Because we are not the best ones of doing that. So when we're talking about creating APIs, it's not this. You can see that sometimes we jumped the gun. Sometimes we start in the different order that we're supposed to be doing things. So as I said, introduce a new concept that it's increasing the usage of press APIs. Then use some of the not so great practices that we are used in our industry. And then develop and test different versions, different environment, heterogeneous machines. And this is the part where I always said, I like these tools for two reasons. One is for development. And the second one is for testing. They were born in testing. But for development, they are also interesting because I can have a very light development environment without footstrapping a huge amount of services because they run great in the cloud. But they may not run so well on my laptop. Anyway, let's continue. So we do have sometimes issues with the order that we create things. But if we start in the right order where we design and document, and then publish, and then have it as a contract to other teams, internal consumers, and external consumers, then one of the tools, if you haven't used it already, I suggest you to have a look. It's an open API specification, the 310. Actually, the latest release was in February this year. And if you start using it, there is a huge amount of tools that can be, you can leverage here. So have a look. And one thing that I already want to tell you is there is a lot of parsers, validations, libraries for testing in different languages. You can generate code, clients, servers, so many, many, many things. And it is a standard. So this is the Swagger Editor because Swagger was one of the companies that started with the Open API Foundation. So they have really nice tools. So this is a way to see and sometimes to test or provide to your consumers an easy way to test a little bit, to test in terms of to use and to document and reuse some of these endpoints or rest APIs. Now, this will go super fast. And I will first go through the slides and then we'll jump into the demo because everything that you see here in the slides runs. And you will see why I'm in love with Wiremock. So Wiremock, it's very, very robust and has been among us since 2011. So it's a very well-established tool. And for example, you can run it in standalone. That's the first thing that people sometimes are surprised. You can start recording using it as a proxy and record and replay some of the mappings. You can use handlebar templates to create responses. I will explain why I like it so much later on once you have seen all the capabilities. So how do we add mappings? Very, very easy mappings. So actually, I'm going to wait me a second. I'm going to jump directly. I hope you're still watching me. Oh, my goodness. Wait a second. So I want to share you as soon as I get there. Perfect. Sorry. I'm going to share my entire screen now. And you will see me briefly. I hope not a lot. OK. And let me try to make this bigger. I hope you will see it correctly. So what I'm doing is starting the Wiremok in the standalone version, the latest version. And I'm actually able to look at this. Sorry. Can you increase the font size, please? So if you know what I'm going to do, just share my screen, this screen. Wait me a second. So I'm going to share only this screen. Yes. I hope it's better. Now it's better. Not much. Not much. Can you increase the font size? This particular one, you don't have to see that well. But I promise the other ones and the slides will be available. So this is only just for you to see the capabilities. So let me view. Let me view and make text thicker. OK. OK. Probably that's better, isn't it? Yeah, much better. OK. So what I'm doing is only creating what corals some request directly to my local host AT-AT where I'm running my wire mock standalone server. And what I'm doing is passing a request and response and then only requesting with that specific endpoint that I just created. So I can create really simple ones. This one is going to return a JSON response. So for example, what I'm doing here is saying whenever you get the URL, get JSON with the method get. You will return to 100 and you're going to return as JSON this on conferences. So we do the request and there they are. So now I have to go really fast. My Andres, if interesting fact about my life, my husband, it's also a developer. So he's like, you present a lot of examples about wire mock. And I'm like, it's because I love it. I love it and I really love it and it's super powerful. So what are we doing here? We are using a URL path pattern. So I'm saying that whenever you get a slash get and whatever you pass that it's small cases and tests, you're going to return here is with a pattern. So I'm creating whatever. And now if I use full test, there it is. So we can have patterns in the URL too. Now, what happens if I want to pass specific patterns in the body of the request? Well, you can also do that here. What I'm saying is that when you get a post method in this URL and you have to wait for the total result is four, otherwise this is not going to work. So and there it is. I received that 200, so it was okay. Perfect. So get a post. You can do all the methods that you want. Now, this is going to be a little bit more complex, but again, super interesting. So what I'm doing here is using our request model. So with a response template, this is the part where I was saying that we're going to start using a template with handlebars. So when I get the get multi-query, I'm going to pass as the body here. And this is the important part. The request query things. And see how I'm using it. The first, the second to last element in whatever I pass as a query and the last element on the request. So if I pass this request, the first element is one because it stinks, one, ah, this is important. I'm escaping this because I'm using C shell. Don't ask, I, for, it's very useful most of the time. Second to last is going to be two and thanks the last element is going to be three. If I were to pass only two elements, then the first one is one. The second to last is one because I only have two elements and the last element, it's two. So if I were to pass a new one, and this is why I usually copy paste because when I'm nervous, I type so slow. So now if I pass that and it was totally incorrect, as I told you, one character and I'm doing it incorrectly. So the first element, it's one. The second to last is three and the last is four. So as you can see, they are very, very, where it allows this kind of stomach really easily. And it also provides functionality for other kind of functions. For example, date, date and time. So what I'm doing now is passing in the body then now as in now, the Java now. So if I now curl the date, it is now. What a surprise, now it's now. Okay, so let's continue. Now I'm going to use offset. It has tons, tons, tons of different functions. Actually, I will return to the presentation to show you because in the slides, I put most of the functions that you can pass. And so you have a taste of what it can do. So in this case, I'm using the offset with one gear. So yes, it's now, but it's 2022. So I hope things will be better there. Okay, so now we have seen time, date. Let's see another one that I also find very appealing, which is the random values. So in this case, we're creating a random value of 27 characters. Alphabetic and it's going to be in upper cases. And in the URL random, if I call it, bear the yard. If I call it again, another one, another one, another one. And you get the idea. So these are all the functions that we can use. We can also use integers, decimals. So let me clear it again. Now we're getting an integer we can say from five to nine. So we have the lower and the upper and I only get eight, seven. So of course, this is not going to be very surprising because the limits that I put are very restrictive. You can use math, math one plus two by module, et cetera, et cetera. Let's see another one that is really interesting. So what happens if I want to use regular expressions? Well, you can use regular expressions. Again, Excel, this looks so horrible. This is because I have to copy and paste from CShell. So in the documentation and I have notes there, you don't have to do that, but let's say, let's see. Now if I do a curl passing as the payload in the body as the nation, the regular expression, it's only letting it pass the small lower little strings. Lower little strings, well, yes. And not the number, it's if I pass the nation 2021, it only returns the nation. What else? You can part it like parts. Once you have the regular expression in the request body, you can get this specific chance that you are interested on. And another example. Yes, I get too excited with Wiremog. I know, I know, bear with me. So what happens, what other thing that we can do and it's really interesting, we can delay. So the Wiremog allows you to have this stopping with different delays and you can have fixed delay, you can have distribution type of delay to make it more random if you want. Oh, let me, let's create it again. And let's get it, it was, it will eventually come, eventually, it can be logarithmic, it can be uniform. The other one that we can also do is chunk variable delay. And I actually going to return to the screen to the presentation, bear with me again. You know, frustrated by your windows. So I'm going to share it again. Okay, let's share the entire window. Why not? Wait a second, start a window and yes, you will see. So as I said, the standalone, we enabled the local response templating. I didn't show how to record with a proxy, but I can do it at the end if we have time. I wanted to show you like where is the nature. So this is already the example that we were looking into and with some of the modification, but this is the important part. So this is what I wanted you to see. So we have time and date offset. We can send different time zones like Australia, Sydney with a different format. We can send it in Epoch, we can send it in Unix, the random string. We can send it with a different length, different type. So as you can see, it's very, very, very polyphasitic. Integers, we have decimals. You can specify the lower value, the upper value. As I said, mathematical functions and the regular expressions. As I mentioned, you can set the regular expression to extract into the request body and you extract it in a specific pattern and then you can write down that pattern as you want. And this is what we were looking at into the fixed delayed responses with the distribution. This, the one that we created was a log normal distribution with those values. You can have the uniform, the log roll normal. You can get the chunk delayed to mock really slow networks. So you can say, oh, send it in chunks and five chunks with a different duration. And not only that, and this is something that I also like, simulating folds. So you can say that you have a mild form response chunk or all this kind of folds. So, and the other one that is really, really important as we are requesting different endpoints where Mock is checking how close we were into the specific mapping that we had and it also keeps track. We can identify the request. So we can also check if we have been calling once, twice, more than once. So it's really, really interesting and powerful. Again, something that I will show you right now is that all these mappings, the information that I created with curl, that is horrible. I know, but I wanted to copy and paste really fast are being recorded. So at the end of the day, you will have two directories. One with the files and the other one with the request. And in the request, I will show you how do they look. So you can reset, delete them. And whenever you start your Mock standalone drawer, it will actually check what you have in this directories and use them. So the admin API, so you have an idea of what you can do is create a new one, delete all, reset, persist. Buy ID, et cetera, et cetera. The other thing that I didn't mention and I didn't have enough time or I didn't want to use enough time for where I'm up because rest assured it's also very, very powerful is the scenarios. So to make this even more powerful is to create the steps the first time that you request to a specific endpoint, you get an answer. The second time that you request to the same endpoint you get another answer. And this is a step-wise response. So this is what it's known as in this scenario. Okay, so something really interesting. If you are using Chrome as your developer development the browser, as I do, there is an extension that is really quite nice. I'm going to demo it right about now before we jump into that. Let's see here. Let me make this huge. So well, not huge because then I lose that with me a second. So this is, this are my mappings as you remember I was playing like crazy showing you the different with curl and I was connecting to my standalone Wiremock server. So here they are. And you can see exactly what I did with curl. You can see it here. So you can create or did something. So it's a really, really, really nice addition to your Chrome developer, to your Chrome extensions. So let's go back and this is the directory. Almost the same directory where actually the same directory where I'm running my Wiremock jar. So if I use three, let me get it super big and let me increase the size. If I use three, you will see that I have what I told you, the files and the mappings. So, but you see that I have so little of them and in the, in my Chrome version, I have to nail that better. Sorry, you are like my, okay. Sorry. So what you see here, I have more mappings defined that the ones that I have in their directory. The reason of that is because I haven't persisted everything, just check. And now I'm missing my, let's go back. So if I want to persist all the ones that I have in memory, I only need to call something that really looks as, let me see, finally. And then if we now do again the three, you will see that I have more. And what I wanted you to see was not only that, by list. So what happens if I open one of the mappings? See there, I have the get date, get date offset. It's created with a different identifier, there are requests or the stopings that I was creating. So as you can see, why I like Warmog so much. Because if for some reason you are the backend development team and you're from them, the development team really needs to completely work as sync with you. Instead of telling them download this version and story this is here is a jar. Here's are my two directories. There are plain text files and you can run your own mock as simple as that. And it's plain text so if they want to, they want to create something weird or different, they can do it. They can even play with the delay distribution to generate their own faults if they don't want it. So as you can see, Warmog for me, it's not only for testing but it also helps us developers and the different teams to be more productive. So let's go back. What happens if we are not a curl fan and we are also not fans of Atom, we are Java developers. So what do we do? Before I jump into the Java part in the few minutes that I have left, let me talk about another tool that I love, it's rest assured. Why do I love it? Because it brings the expressiveness of Gruby for parsing JSON into the testing arena and it is fantastic. So let's go with the coding part of this. View, let me open. This is the Warmog. Let's increase the size, let's increase this. So, okay, perfect. First, super interesting thing for you is Excel is going to use Gruby, the version 309, and it's going to use the Gruby console. And before you start vaping, how crazy is she? Let me tell you why I do this because there is a reason for that. And the reason, as soon as we find my window, let me increase this. The reason why I'm using the Gruby console is because I like my coding examples to fit in a single screenshot, one single file and you should be able to run whatever I'm telling you. That's my aim. Usually I can make it happen. Sometimes I cannot. So let's start from the beginning. So we're going to show, I'm going to show you how to use Warmog, the unit five, and the latest version of rest assured. So we're going to clean nothing under the sleeves. What I'm going to do is to start a Warmog server. We are going to create a very, very small JSON object. And we're going to create two endpoints and one is 200, the other one is 204, and we are going to assert things. So now if I execute this Gruby script, we can see that there is zero failures. And I'm happy. And we're running in the port, well, 190. So the wording in the slides were because I'm faking the server with Warmog. I'm faking the client with rest assured. What am I testing? Well, I'm testing that this is super simple to do. I'm showing you how you can fake both things. Usually you shouldn't do it at the same time as I'm doing here, but you get the idea. So this was the like, hello world. I will create only, most of them I test here to keep it inside the Gruby console, a hello world, maybe a little bit beyond the hello world. Here, I also created, let me first run it. So we see that I don't have any failures. It was reasonably fast. What I'm doing here is I'm creating a stop for this URL, JSONPET, with that UUID, it's going to return. And this is important part. It is going to return a file inside, well, that is contained in the pet.json inside of my folder resources. So I'm checking that it's actually happening, that I'm changing my stop, and then looking that I'm really doing what I'm supposed to be doing. Well, as I said, I'm faking everything here, but at least I'm consistently faking. So how am I in time? It's done, I hope we have a still time because I almost there. So again. Well, it's not here, but I am here. So what depends what you wanna share? You're just three minutes over. Okay, no, I'm going fast. Don't worry, I'm all there, all ready? Oh, so yeah, it's just three minutes. Sorry, then it's amazing. You should try it, take my word for it. The slides are going to be there. And if I didn't manage to convince you to take a look into Walmart, shame on me. And as see, it was the last one. Almost in time. Almost in time, thank you, Shell. It was groovy. Thank you. But it was amazing. I totally recommend you to use Walmart when you need to mock the real things and totally give a try to Walmart in Quarkis. Words like a term, especially when working with rest APIs. And as the Shell mentioned, if you need like to help your frontend colleagues or help your colleagues that are interacting with your APIs, definitely use a Walmart. Definitely use JUnit to test and unit test your work because the tested work works the best. And I need to thank you again. Do not forget to share all the good stuff, the repositories and everything with us because yeah, we are keen on trying things on our own and we do need to be like trying more with our Walmart. I didn't use some stuff with Walmart, the ones that you shared. And thank you again.