Testing with Spock, the logical choice by Iván López

okay let’s start so hello everyone thank you for for having me here at big 12 Jack 24 and letting me talk about about the Spock so what’s the Spock well a Spock is a is a GUI based testing and specification framework for for java and for groupie applications that makes writing tests fine again and we can write beautiful and highly expressive test because of of its ESL and all the power that groovy provide us so we can write let tests with less lines of code that are going to be very very readable Spock is totally compatible with a unit so you can use your standard tools which means that you can use your ideas such as Intel yay cliffs NetBeans your build tools maven Gradle and your continuous integration servers Yankees bamboo whatever you use shield using this talk I’m going to show you a lot of nice features about Spock so maybe at the end of the talk you can try it Spock in your in your current project okay first let me introduce myself i’m even lopez at ill omen on twitter I’m i work at ruby on rails developer i’m a member of the greatest impact oci OS oci eats the home of of the rails team now i’m also the coordinator of the madrid groovy user group our local Group E Group in Madrid we have meetups once a month and i’m also the organizer of the grid conference reaches a conference about groovy in in madrid this past April was our fifth vision and next year we have our six we haven’t announced yet the dates and you have in our webpage all all information and I’m also a regular speaker in different conferences bring one called motion great cove spring I oh I like to talk about about groovy so we can I could spend something like 20 minutes talking about why it’s important to test our applications and explaining out of theory about unit testing and all that stuff but I assume that you will test your applications or at least if you don’t test them you know the benefits of testing the applications right and on on the other side we are developers and and we love to see code so instead of talking about a lot of theory but I’m going to do now it’s yet let the Spock so this is basically my last slide and good i’m going to do is just so use something like a spoke in action so here you can see I’m using IntelliJ and I have created this this project it’s a greater player so the first thing you need to do all the only thing you need to do if you want to try a Spock this lines doesn’t exist yet is just add X poke out the dependency right I am using the latest rc2 version and with only this line you can guess start using a spark with this version a spot came with or or has its own groovy version so this version is using groovy two point four point six so if you want to use a different version yoga you can just add it here because I want to use the latest groovy version right and that’s all that you need so with this very simple setup we can start writing our our test so as I said this is a great project and it’s a the standard layout source main java and I here I have some Java code that I’m going to test using a Spock and here source test groovy I have my test right so let’s start with a very basic one so the first thing we need to do if you want to write a spot test is create a class and extends from a specification spoke length a specification as I said a Spock it’s compatible with j unit and as you can see here his spot use this and rang with which is the runner yeah you need running and a Spock has its own runner which is the name is a Sputnik the name comes from a Spock and yeah unit and here it’s all the code that Spock needs to do to be able to run as a J unit test but you don’t need to worry about it so nest expand from the specification and you are ready to go so let’s write our our first test this is a very simple one and

the first thing you can see is that you can write the name of the test using plain English you don’t need to write these method names with camel case that sometimes are not readable so let’s write plain English and the other thing is that a spoke force us to write our test using this be DD Form given when then so the first thing you you can do when when you start writing a new test you can do something probably like this you can write your labels giving when then write a small description or what you get when you want to go so in the given block you have your your start your setup so i have an extreme in the when this is what i want to test I want to test what will happen when I’ve reverse the string and in the end block I have my assertions Oh everything here in the land block our assets so I don’t need to write asset here bliss it and as you can see it’s very it’s very simple in this case so if you are used to use a unit you probably can write this place in this giving when them for but you will you will end up with something like this even when then in comments because you don’t have to or you can’t use this form with your unit right the nice thing about this let’s run this test oh it green so then I the next thing about this giving want them block form is that Spock force us to write the test this way so I can’t do something like this then true if I try to run this test now it’s going to fly I mean it’s it doesn’t compile because then is not allowed here right so you want you need to write the tests in the right way okay so let’s fix this and this is the as I said the regular form given one then but sometimes for these examples this is very verbose so we have a shortcut which is expected with this keyword or with this level what I what I’m saying here is I expect that when i execute this it will be this thing hello world reversed right okay let’s move to the next example here let’s talk about power assets so it’s important to when a test fail it’s important to to know how to see why the test has Faile right so this is a very simple example x 3 and 5 times 4 which six is not 20 so if well the first thing I need to do is Jets commend this annotation up ignore the same as the unit with this annotation on a class or on a method test this test will be ignored but the Spock has another really useful impatient which is called ignore rest add the case the use case for this is that imagine that you have a test class with I don’t know 25 tests and you are focused only on one of them you can put this annotation on that test and guess fixes fix it and run it and a spot we only execute the test that has this annotation right so let’s run this first example and let’s see what happens okay it has failed and you can see this nice output you can see the value of every variable here so 2 times 365 times for its 20 which is false right this is what I expect 20 but this is what I get six this is a pretty simple example but I have another one that you will understand line with you better so I have this data this is a groovy syntax for a map Sookie name value even ph value 46 and this is another key which has a list of elements so what I want to check is that the name of the first child could be adryana but it’s not because this is a list so if you did this test is going to fail right let’s run it and as you can see we have the values of every variable involved in the assertion so in data we have everything then we get a structured child which is just this list dead then we get the name of the of the child you detain Adriana the first one you did which is not that Rihanna right so you can see here even this this thing they they are forty percent similar although i should say they are they are not that thing they

are more similar because they are both my daughters and their siblings but anyway you can see here that do you have all informations all information to know why this test has failed you don’t need to put a breakpoint and the book the test or write a lot of print lines to actually seek what happened here okay let’s move to the next 10 as i said i want to show you how you can use groovy to test your java code so here i have this data helper and this is this is java code you can see here this Texian Jabba and you know that is this code is java because it has semicolons and it’s really a bit verbose but anyway here I’m gets returning a Fibonacci sequence with this elements 1 1 2 3 5 8 and 13 so I’m returning a list of integers and I here in numbers and what I want to test is that when i add a new number and this left shift operator is overloaded in groovy for list so it’s the same as I if I execute numbers dot add I want to check that this list contains the this this value that I have jets avi run it and it’s screen right so we are testing here are our Java code remember this is java and we are casting here from from groovy another example this is more interesting because here i have this list of users so user is just a polio with name last name constructors gettin on setters so nothing new here and i am creating a list with for users cell long learner russian so this is a pretty common pattern when when we do test our application because we for example go to database get some data and want to do some checks on the list of objects that we have returned for from the database so let me put this here i’m going to do deals and i’m going to do this so this is our these are some things that we can check about this this list that i’m going to return so that the size is four because i have for users the name of the users are seldom learner runs and hover in this order right disorder here if i short the names alphabetically now the names are Howard Leonard res and so on and we can do more things so for example we can get the last name of the users and create a new list with collect with the size of every last name so now this is 6 10 12 an 8 because Cooper has six letters who’s topper has 10 good crew for Bali has 12 and wallet eight and in the last line here what I’m doing is yet getting the the user with the smallest name right and I want to take here a moment because this user’s name if you are not very familiar with Ruby this is probably something that you are thinking how this is working because remember in users i’m storing i’m saving here this list of users and I’m gets executing users dot name so whoa mean users dot name oh here I’m sorry users I’m getting the name of every user on the list we can write this here with this spread operator which is practically pretty much the same it will execute this method or this call on every object of the list we can also do users dog collect to create a new a new list but I can say here I code name and as you can see in pella game knows that this is a user’s list so i have a completion for name last name okay I can also do something like deep in more probably a more job away which is good name right and if i want to go to more agile approach you can do something like this i’m going to use the string api so a stream so the first thing I need to do is just map and here i need to pass a lambda in groovy we have closures which are pretty much the same as lambda so instead of passing nalanda i’m going to pass a closure okay so i can say again ik dot name and then i need to collect electors to list right and in this final one this should be probably the most

gabba common code jeez get sorry you get so I going to run this test again and as you can see it’s the same output in every step so let me delete all these intermediate steps because I want to do I want you to compare to show the difference between these two lines of code they are the same right and I can do here miss here so if i run the test it should pass again okay but once you know how to read this i think it’s way more readable that’s that baseline i’m not saying that you cannot redesign because it’s pretty simple I string the least I extract every name and then i create a new list with the names but remember your test needs also to be readable so why you want to do something like this if you can write gets this line here okay and for the legs for the last example here I have another method which is I’m returning a hashmap quickness with this three keys name last name and age and good time doing here let me do this again we can do some checks so I want to remove the name key so now the map size will be to the the key set won’t contain now the name and here you can see three different ways to get a key from from the map this one needs the other way to do this and this this first one it’s the more groovier way to get the key so map dot key and we can run this test and it should be green okay let’s move to the next one sometimes you need to check what happens when you coat frozen it’s an exception so I think that the best is room it’s readable I try to convert foo to a long and it foo is not a valid long value so this pace we’ll throw number formerly stay tuned and this is what I want to check right I’m going to to run it it fast and I can do even more things so what I’m going to do now is get safe here the back section and I can do assets on my second so as you can see in cali a guy knows that this is a number format i stepped in and here i can check anything I want so for example I can check the message so this should be something like for input as string foo let’s run it again oh it has failed right click on eight now it’s green so imagine that instead of launching or catching number four- threatened you have your own accepting doraki and here you catch your own exception and here you can paste whatever you want your message your error code some custom fields whatever you want right so let me tip a little bit come here should not throw and accept it so now now instead of checking that an exception has been thrown I also can’t check that this number format exception has not been thrown right because now the number one two three it’s a valid long long long number okay and the last thing i want to show you here with this example is what happen if i throw if i catch another s stepped him so for example i’m going to catch nullpointerexception and and this pace is going to fail because the expected a setting type was number not null pointer exception but the code actually throws number formatting septum right so with these methods you can check pretty much whatever you want relating related with with the step teams move to the next one so they can driven test this is a this is one of the killer filters for of Spock I think that you can do something like didn’t like this one in j unit using parameter Rice’s test so the thing here is that imagine that you have one piece of code that you want to test in this

example it’s pretty simple I want to check that the number is it’s an even number and you want to check this code with a lot of different inputs right so instead of copying and pasting this test a lot of times you can do something like this we introduce this new label which is where and here with where we can define variables that are going to be used here on the test so this test is going to execute it five times and in every iteration have one of these values gets put in this left shift and a lift on a list of values okay so another iteration about this one is that here we are using yet one variable but we can define whatever we want so I want to check that the minimum of x and y its result and here i am defining gets three variables but here the the thing here is that you need to read this these variables in column mode so the minimum between one and two is one the minimum between minus 1 and minus 2 it’s minnows minus two so it’s it’s nice but we can do it even better right so here we have this table format and here it’s this code it’s the same and as in this example but here we are waiting this this table and now we can read the the test in raw mode right the minimum between one and two is one so for example let’s see what happens with one iteration 1 value fails I’m going to run this oh and we can see here that the test has Faile and here we can see the values this is a pretty simple example so you will see here that minus 2 minus 1 okay I know how to fix this but with when you have a more complicated values or example or actual real code this won’t be that simple to find imagine here have a very big table with I don’t know ten rows right so we can do it even better so for the next example it’s the same but I have to hear this unroll annotation so what the spoke is going to do is just create let’s make this fail again create a new output on the on the test report for every for every row in the word table right so now we can see here we have three different outputs and we know that the second one which is the index one has failed this is good this is an improvement over the previous example but we can do it even further because here but we can also do is just replace in the name of the test the variables X Y and result that we are using here so now if I run this one we can see that the minimum between minus 1 and minus 2 it’s minus-20 which is not so this test has Faile right and for the last example here I want to show you well here i’m using a list but we miss a left sefa breaker in the world block you can use anything that that it’s a terrible right so i have this example let’s start window in the world Brock I have these users this a CSV file with user name and last name right clock what I’m going to do or what I’m doing actually here it’s i’m reading this file i read the lines and i am creating a list splitting by common so basically I’m parsing this csv file and please don’t do that don’t do this code on production this is a very ugly way to parse a CSV file it’s fine for for for a demo and for test code but for production code please use a library to parse esv right so with every part of nameless name I’m creating a new list with the name and dealers name then with these values we can go here to the given part and here i am using a groupie trick this is called coercion I’m converting 9 coerced in this map remember name key this is the key key and value key and value and I’m course in this map to a user and this is working because user has this name and last name and again this is yellow code but the first thing I want to check is that this user instance is an instant of the user class and also I want to check that the name and the last name our code I expect and I think that you don’t leave me because this is not a trivial or not that simple example so what I’m going to do here I’m going to add a new

name a name here what I’m going to do is let’s put this and roll a notation and write this name equals B name and again in cali guys knows about this and i have the completion here on the name and last name equals V last name a so let’s run this test and as you can see here I have the five user names and the test will pass what has been passed right okay let’s move to the next one e6 lifecycle xpac has a life cycle that you can use to hook into the execution to do something that you want right I have here this just to test that will only bring test and test two and you can define these methods set up a spec set up clean up and clean up a spec you don’t need to define the test in this order you don’t need to declare all of them you can use whatever you want so the thing is that set up a spec will be executed at the very beginning of this specification this disco this test then set up will be executed before each test then we have the best executed then clean up then set up test clean up set up desking up and so on and so forth and clean up a spec will be executed at varian so if i run these days you can see here set up a spec is executed only once at the very beginning clean up a spec only ones at the very end and then set up the first test which is this one clean up and then set up test to clean up okay so you can use this for example to la piña i don’t know a connection to the database to create some objects and to do all this initialization setup that you sometimes need to do when you are testing in some code okay so here this is another example imagine that you have this this test and you want to share this user with these two best so the first thing that you can think is okay let’s define the user here and it will be the same for both tests right x equals happen if i run the best so as you can see they are not the same user so this code it gets the same as this one bev set up user spring okay this is exactly the same code but this is worst so there is if you remember the previous example about the life cycle maybe you can you can think okay instead of using the tab that will be executed at the very beginning of every test let’s execute or less define setup expect which only we only will be executed once at the very beginning so let’s see what happen if i executed ok so the goal doesn’t compile here you have an error only share and static fields may be accessed from here and this is actually the answer to our code so what we can do is use this utter annotation right it’s a notation let’s run it we are achieving two things the first one is that we are achieving we are sharing the this user in all of the tests and the second one is that it’s something like the common pain documenting your your test right the the next people that we will try to modify this test which will see this share an ovation and we think okay this usually shared in all of the tests so I need to deal with it and this cert is also useful because here i’m creating guest a user which is a it’s cheap to create a new user but sometimes you can open here a connection to an external service database and you don’t want to open an open and open again the same connection or create this expensive objects right okay let’s move to the next one mocking this is important right xpac games with this its own mocking and stabbing framework you don’t need to use mojito or power mark or anything else and mocking it’s it’s important to to understand the concept because when when you are testing some code sometimes you have to deal with with some collaborators and when you you need test that code you don’t want to deal with these collaborators because you are going to unit test them in another place

right with mocking what we are going to do is just replace this collaborator with a mock object which is an empty object in which we are going to test behavior so let’s see the example here this is squat I want to test I want to create i’m going to create a new user so i want to i’m going to test what happen when i create a new user in this user service ok so this use of service this is a game java code and this is a standalone example but you can think about it gets for example using a spring framework I have this collaborator notification service I use constructor injection so what i’m doing here is basically i create an user store the user on database do all my business logic and at the end i want to notify the user for example sending an email that the account has been created right so when I unit test this code I don’t want to deal with the notification service I will test notification service in another place but now I don’t want to be bother but notification service oak what I want to do is let’s create a mock so I’m going to mock notification service which is it just an interface I don’t have an implementation for 4 News Service and here I create my user service with this mock right and when I execute this code what I want to check is that this send notification has been executed only once in this notification service let’s run it it’s green right and here the the underscore means I don’t care about this parameter because remember is here I’m notifying to a user and with this message you should create it ok so if if you don’t care about any parameter you can write this and it would be so a spot we will we won’t check any of those parameters and if you don’t care about this method you can put here another under scone so for example let’s run it excellent and if you even don’t care about the mock you can put here another underscore and here you know how it’s going to end if you don’t care about the number of times that this mug it’s executed you can put here another under stone right so this is really ugly and this is really bad if you if some of your co-workers write this code you are allowed to punch him or her or I don’t know cut a finger or something like that because this is really really ugly called you shouldn’t do this right the only use case to do this is here imagine that you want to check that after this method has been executed on the on the mock service no more mocks are executed so you can put here a zero and let’s run it it’s it’s green so if I get executed so for example if I execute this twice this test now is going to fail right okay well it has failed because i put here and one but it’s the same so this is pretty common so there is a circuit which is this 10 times underscore this is really useful if you want to make sure that only this method has been executed on the mock object let’s fix this so here I said that I don’t care about this parameter but you can do some behavior so you can check something on those parameters thing is that here this user it’s it’s a local variable that I’m creating here inside this method so I cannot access to this to this user from outside of this method right now with a Spock you can put here across sure and check whatever boolean condition you want about this this variable so here it’s a user so i can check that the name is even right and sometimes you need to mock an implementation so let’s go back here remember these two lines if you want to mock an implementation you need to add this see you leap dependency on your classpath because if not xbox one vehicle komaki implementation you should use interfaces but sometimes you don’t have another choice and you need to mock an implementation so email service now

it’s yet and simple implementation it will just print these values so with this mock what I’m going to check is that when i call this method on the mock it’s executed right and the last example is about the order of the check so imagine that you send three messages and you want to make sure that all that the messages are sent or process in this right order so message one two and three right so you need to put three then blocks let’s run it it’s green add now if i change the order of the messages to 13 and run the test again it was going to fail because a Spock will force the order in every damn block bad if you remove these then blocks and put all of them in the same damn block but they’ll be good this is going to pass again because the Spock won’t check the order in in in a in a ten-block so you need to put more than then block if you want to check the order between between them okay let’s move to the next one stabbing so with with with mocks we replace our collaborators with an empty implementation right with a stabbing or with a stop what we are doing is yet modifying this this object dis collaborator and make make it to return a pretty neat value a value that we want so i have here this user repository it’s again an interface i can have them to an impatient and here i have two methods I’m by IV which receive an idea return a user and find all the last name we receive a last name return a list of users oh I can stop this repository so using this keyboard this this method name stop use repository here i can define the method that i want to stop here i’m saying i don’t care about the parameter and you need to return something that will have the same signature so fine by IV is returning a user so here i need to return a user so when i execute this fine by any method on this stub repository a spot will return this this John Doe user right we can define also different values for every call so here i am using the left the right operator and here with this one I don’t know the name sorry inside of this list you can define more than one user so for the first call a Spock will return the first one for the second call it will return the second one and here I’m gets execute in the method three times but I only have two users here so a Spock it’s going to return the last value right and again here I don’t care about the parameter I am gets calling with one and in user one I have done because John is the first element of this list and for the user to and use of three I have Jane right because it’s the second one and it’s the last one for for this in this call we can also return values depending on on the on the input so if I execute this fine by ad with 11 here it will match with this one and it will return John it doesn’t matter if i have defined first 20 and then 11 and call it in the other way in the other order so 11 it’s here i it’s it’s yan so juicer 1 john and user to its same we can also stop our repository route to for example throw an exception so we can we just need to write inside this closure the septum we want throw new runtime and stepped in and here as I already show you can see you can check that this accepting has been thrown and this is the message so for example if i change the message and run the test ok let us fail because the message is not the same and for this last example and i want to show you that you can stop more than one method right in user repository has two methods and in all those example line i was only a stabbing primary but you can define all the methods that you want ok so let’s run for the next example I think that I won’t be able to finish all examples but not worry because the code will be available on github and these last

examples are pretty simple right so here this is pretty common I want to check something so what I want to check in squad would happen in the size of this list when I add a new number this is how you define a list in groovy with a square brackets and here you can do something like this so and the size is numbers block size right and after adding this new value could likely to the list I want to check that now numbers dot size it’s the value that we previously save lose one right this test should be true to be buzzed right and we are doing this because we are developers and we think in that way so we know that here we need to check the old value so we are going to get safe the value here and use it here but this is not how a regular normal person we think because what what what we are thinking in our brains is just actually I want to check that the number sighs now is great all value of the number size plus 1 right this is the same as is green and cut the spoke is doing with this all its jets what I did he says he is Spock sis here okay numbers aside I’m going to move this code to the given blog I’m going to execute it i’m going to save the value and then i’m going to use it here so this all its it’s useful you can use it not not all the time but sometimes and i think is at least one that one so this is this this thing that i’m going to show you now was introduced in a spoke 11 dot one so what would happen i’m creating a user here and i’m checking that the name and the last name are not the same so if I execute this test what is going to happen is that it’s going to fail because the name is Yvonne and then I fix this test I’m run it again and it’s going to fail again because the last name wrong so yeah it’s sloppy so this is a default behavior of Spock it will get stopped after the first failure but if you want to make sure that all your blog has been is check you can use verify all inside of of this closure and Spock will verify all of the your assertions here you can see that let me put this year user the name it’s false and then another condition user lastname it’s fall so all of the assertions has been checked this is really useful because sometimes you don’t want to fix the text the test one and over and over and over again because you have a lot of ourselves a certain thing as substance here sorry and every time you fix one you have any failure right okay let me show you I think the last thing I’m going to show you I’m is keeping two examples but they’ll be available and they are pretty simple and the last thing i want to show you miss this all the dependency that i have here this is a miss miss Spock report so what I’m going to do now is just execute all my tests using Gradle right and I don’t care if some test fails sometimes pass I only want to execute the full test battery okay you can see here that all the output and what i want to show you it this one this is the output of the past so here in test results we have these xml and these are the these are the xml these are j unit compatible so you can put these on your Jenkins for example to see the the output and has anna half a nice report and here we have in this reports folder we have this index let me open with firefox so this is yes gradle a standard and test report right some tests on sale we have ignore test some failing packages some stats but with this Spock reports on the class but we have here a new folder it is called Spock report let me open this index right so this is basically the same information at here someplace else fails Sante Kimes has been skip ad let me show you this one basic here and basic here let’s go back to this example in one and as you can see Ike right here this a small explanation of what I’m doing I

only did this in this example but it’s a good practice to write gets a small line explaining what you want to achieve with this test Oh with radial you can see gets the name of the test but with a Spock report you can see that this information has been instructed and it’s a valuable on the report right and the same will happen would happen if we open this data driven here we can see gets the test but with the Spock report we have all our values or our tables and everything that that we have the fame define and the nice thing about this Spock report is that you can customize the the visa styles with the CSS and this page so you can put your your own logo your company colors whatever you want and you can create these nice reports for for some people some for example for some business people because they will probably can read something like this right if you write a spec and where they they can understand this they are not they don’t need to be as technical as you and they will be able to understand that and I think that so let me finish my slides all these are gaps resources the first one is the spot framework webpage here is the github repository and the last one is the documentation the documentation it’s really good they explained Phineas Bogg Mork and all of that and I think that’s all if you have some questions now I think we have some some time so lets me stop share my screen so Simon oh uh yeah thank you very very much happening it’s always good to see a kind of a very fluid live coding demo so that was that was awesome so if anyone has any questions feel free to drop them straight into IRC there’s one question actually from korsub you saying out of curiosity this is actually a while back maybe 20 minutes ago no 15 minutes ago who are using constructor injection and not Springs auto while annotation yeah because here this is as I said it’s a plane plane java java test so it blends get a code end up using spring here but you can use out while although that is considered about prosti back bad practice you shouldn’t use define your private collaborator and out of white you should use and constructor injection because in that way you can replace that that object that collaborated with them up as i as i did so you should do a constructor injection right so a couple questions now our style so is it possible to reuse the same parameters but for different users the different test cases is it possible to use I think that you can I mean you need to copy our put the word block in every test case but I think you can instead of just returning or writing her cadena a list with all your values you can call a method which will return the values that you want you can write a private method on the same test class if you want and just call that method from different tests so yes you can do it okay another question from Matty Matty in IRC hi I want to ask about spring applications with contexts running it says that there are some problems with mocking beings could you tell us how to deal with Spock mocks and spring beans yeah there there’s not a problem we I use I developed great applications and grails uses spring under the hood and i also have developed a spring boot applications and i always test I always I always test my code with with a spark so I don’t have any problems you can just mock whatever thing you want and if you are just executing integration tests with the context running you can also do it although it’s dangerous because you are mocking a beam that it should be singleton and you are just replacing the vin on the contest so you will have some unexpected behavior in in other context in order test sorry but you can do it there is another dependency that you got you can add to your project which is called I think spring a Spock or ass pocket spring I never remember the name and you can use it to to integrate in a in a more fine way with with a spring but yet you can you can use a spoke to test your your spring framework applications various sample projects or anything like that with importunity there’ll be something around yeah I think I think they’re there are some some samples there yes okay awesome follow actually from Alice tile on RC

asking is it then possible to return a table of parameters from a method presumably this is just returning a hash table rajma if you want to return this table that you right in the word block I think you can’t i’m not sure but i think you can and get returning a hash table or whatever its body but that the table that you can right there I think you you need to write during the word rock okay when solve it just one more question from ledos m cans mock stances it’s okay that it rhymes can Spock mock static methods defined in Java yes spoken I think it’s possible i’m not sure if you can’t use a spoke to mock your static methods you can always use groovy right because you can override the metaclass off of that class that you want to to mock and yeps replace the implementation of that of that static method so I mature now about the Spock but from grube point of view you can get smoked I mean replace modifying the the metaclass static method yet so that’s early that’s almost the questions that we have we ban on time 525 21 here in the UK and so Ivan I’ll just say a big big thank you very very much for joining us on on the on VJ twenty-fours a pleasure having you as a first time speaker so say thanks very much did you do it yeah it was funny and yeah thank you very much for having me here and let me talk a little bit about the spoken and groovy thank you very much it’s a pleasure awesome so the next session are coming up let me share this screen