0:03
well let me introduce me quickly my name
0:06
well let me introduce me quickly my name
0:06
well let me introduce me quickly my name is Ando um I work as developer using
0:09
is Ando um I work as developer using
0:09
is Ando um I work as developer using different languages some of them appear
0:11
different languages some of them appear
0:11
different languages some of them appear on the presentation there are another
0:13
on the presentation there are another
0:13
on the presentation there are another ones that I use it not frequently but
0:16
ones that I use it not frequently but
0:16
ones that I use it not frequently but for example C hcll python most of them
0:21
for example C hcll python most of them
0:21
for example C hcll python most of them not appear in the presentation but I use
0:24
not appear in the presentation but I use
0:24
not appear in the presentation but I use it uh in some period of my life I
0:28
it uh in some period of my life I
0:28
it uh in some period of my life I participate as technical reviewer on
0:30
participate as technical reviewer on
0:30
participate as technical reviewer on many editorials they send me a
0:33
many editorials they send me a
0:33
many editorials they send me a manuscript a book or something I give my
0:36
manuscript a book or something I give my
0:36
manuscript a book or something I give my feedback I publish um some courses and
0:41
feedback I publish um some courses and
0:41
feedback I publish um some courses and books um some of in the presentation and
0:44
books um some of in the presentation and
0:44
books um some of in the presentation and I participate as speaker on different
0:46
I participate as speaker on different
0:46
I participate as speaker on different conference you have my contact
0:48
conference you have my contact
0:48
conference you have my contact information on the presentation so if
0:50
information on the presentation so if
0:50
information on the presentation so if you have any dudes any question after
0:52
you have any dudes any question after
0:52
you have any dudes any question after this talk contact me and I will try to
0:55
this talk contact me and I will try to
0:55
this talk contact me and I will try to help you as soon as possible so what is
1:00
help you as soon as possible so what is
1:00
help you as soon as possible so what is our problem today well we work in a
1:02
our problem today well we work in a
1:02
our problem today well we work in a company which have a lot of
1:06
company which have a lot of
1:06
company which have a lot of microservices and the main problem is
1:08
microservices and the main problem is
1:08
microservices and the main problem is like okay we decided to migrate to use
1:12
like okay we decided to migrate to use
1:12
like okay we decided to migrate to use an event driven architecture we say okay
1:16
an event driven architecture we say okay
1:16
an event driven architecture we say okay we don't want more HTTP or the the the
1:21
we don't want more HTTP or the the the
1:21
we don't want more HTTP or the the the most common type of communication we we
1:24
most common type of communication we we
1:24
most common type of communication we we need to use events because most of the
1:27
need to use events because most of the
1:27
need to use events because most of the company USE events
1:30
company USE events and here appear some kind of problems
1:33
and here appear some kind of problems
1:33
and here appear some kind of problems when we need to check if everything
1:36
when we need to check if everything
1:36
when we need to check if everything works fine or not the first problem that
1:39
works fine or not the first problem that
1:39
works fine or not the first problem that fear is okay how I can check if
1:42
fear is okay how I can check if
1:42
fear is okay how I can check if everything works fine or not because in
1:44
everything works fine or not because in
1:44
everything works fine or not because in a common application I can use different
1:47
a common application I can use different
1:47
a common application I can use different framework or different libraries to do a
1:50
framework or different libraries to do a
1:50
framework or different libraries to do a simple HTTP request and wait until to
1:53
simple HTTP request and wait until to
1:53
simple HTTP request and wait until to have the response but in this case it's
1:56
have the response but in this case it's
1:56
have the response but in this case it's not
1:58
not possible hold so I can check with this
2:02
possible hold so I can check with this
2:02
possible hold so I can check with this kind of architecture if something was
2:05
kind of architecture if something was
2:05
kind of architecture if something was modified into the database imagine that
2:08
modified into the database imagine that
2:08
modified into the database imagine that you need to create a test that do all
2:10
you need to create a test that do all
2:10
you need to create a test that do all the things send an event do something
2:15
the things send an event do something
2:15
the things send an event do something and is an event-driven architecture
2:17
and is an event-driven architecture
2:17
and is an event-driven architecture perhaps not um send an event create a
2:21
perhaps not um send an event create a
2:21
perhaps not um send an event create a new event or yes but you need to check
2:24
new event or yes but you need to check
2:24
new event or yes but you need to check if the changes appear on the database or
2:28
if the changes appear on the database or
2:28
if the changes appear on the database or not and
2:30
not and perhaps in some cases you publish a new
2:33
perhaps in some cases you publish a new
2:33
perhaps in some cases you publish a new events so here you have a complex
2:37
events so here you have a complex
2:37
events so here you have a complex scenario it's not the common scenario
2:40
scenario it's not the common scenario
2:40
scenario it's not the common scenario where you do a simple HTTP and wait no
2:44
where you do a simple HTTP and wait no
2:44
where you do a simple HTTP and wait no because different things could
2:47
because different things could
2:47
because different things could happen and a unit test of course could
2:51
happen and a unit test of course could
2:51
happen and a unit test of course could cover some aspects okay I can check if
2:54
cover some aspects okay I can check if
2:54
cover some aspects okay I can check if some part of my logic works like okay I
2:57
some part of my logic works like okay I
2:57
some part of my logic works like okay I want to check if the persistent layer
3:00
want to check if the persistent layer
3:00
want to check if the persistent layer works or not or my the the the layer
3:04
works or not or my the the the layer
3:04
works or not or my the the the layer that is responsible to receive the HTTP
3:08
that is responsible to receive the HTTP
3:08
that is responsible to receive the HTTP request or the business logic great but
3:12
request or the business logic great but
3:12
request or the business logic great but how we can check
3:14
how we can check everything together the database the the
3:17
everything together the database the the
3:17
everything together the database the the process de the push de and in a real
3:23
context let's see more or less the
3:25
context let's see more or less the
3:25
context let's see more or less the interaction between this application a
3:30
interaction between this application a
3:30
interaction between this application a send an event application X receive the
3:33
send an event application X receive the
3:33
send an event application X receive the event and do
3:35
event and do something into the database change the
3:38
something into the database change the
3:38
something into the database change the the the application or change the status
3:41
the the application or change the status
3:41
the the application or change the status of something and after that push a new
3:46
of something and after that push a new
3:46
of something and after that push a new event so you don't have the possibility
3:50
event so you don't have the possibility
3:50
event so you don't have the possibility to create a
3:51
to create a test or yes but it's so complex that
3:55
test or yes but it's so complex that
3:55
test or yes but it's so complex that check if application X works fine or not
4:01
check if application X works fine or not
4:01
check if application X works fine or not Andre I'm I'm sorry to interrupt but
4:02
Andre I'm I'm sorry to interrupt but
4:02
Andre I'm I'm sorry to interrupt but your slides are not changing oh
4:26
again uh yeah I see your slides yes ah
4:31
again uh yeah I see your slides yes ah
4:31
again uh yeah I see your slides yes ah yeah now yes
4:35
okay okay this is the this scenario I
4:38
okay okay this is the this scenario I
4:38
okay okay this is the this scenario I have an application another application
4:40
have an application another application
4:40
have an application another application and the communication with the
4:44
and the communication with the
4:44
and the communication with the database so why create a test is
4:47
database so why create a test is
4:47
database so why create a test is relevant for us why
4:51
relevant for us why this a different kind of test like the
4:53
this a different kind of test like the
4:53
this a different kind of test like the integration test or a end to end test
4:56
integration test or a end to end test
4:56
integration test or a end to end test anything is not connected with the the
4:58
anything is not connected with the the
4:58
anything is not connected with the the unit test could help us first because
5:02
unit test could help us first because
5:02
unit test could help us first because reduce the risk that something bad
5:04
reduce the risk that something bad
5:04
reduce the risk that something bad happen if I create only a unit test I
5:07
happen if I create only a unit test I
5:07
happen if I create only a unit test I don't validate if the external
5:09
don't validate if the external
5:09
don't validate if the external communication works fine or not so I
5:11
communication works fine or not so I
5:11
communication works fine or not so I will publish or deploy something on some
5:14
will publish or deploy something on some
5:14
will publish or deploy something on some environment like staging and only check
5:18
environment like staging and only check
5:18
environment like staging and only check my um partial functional the the methods
5:22
my um partial functional the the methods
5:22
my um partial functional the the methods or the the the logic but not the entire
5:25
or the the the logic but not the entire
5:25
or the the the logic but not the entire integration I'm not sure if everything
5:28
integration I'm not sure if everything
5:28
integration I'm not sure if everything works fine or not
5:31
works fine or not how I can verify the problems because
5:35
how I can verify the problems because
5:35
how I can verify the problems because one of the things that I need to be sure
5:38
one of the things that I need to be sure
5:38
one of the things that I need to be sure is that when I send or create an event a
5:41
is that when I send or create an event a
5:41
is that when I send or create an event a new event the my application X create a
5:43
new event the my application X create a
5:43
new event the my application X create a new event is have the all the
5:46
new event is have the all the
5:46
new event is have the all the information that I want the same format
5:48
information that I want the same format
5:48
information that I want the same format that the consumers could process so I
5:53
that the consumers could process so I
5:53
that the consumers could process so I need to do all these kind of
5:56
need to do all these kind of
5:56
need to do all these kind of things it's not a unit test again I unit
5:59
things it's not a unit test again I unit
6:00
things it's not a unit test again I unit test not check the entire behavior of my
6:03
test not check the entire behavior of my
6:03
test not check the entire behavior of my application not check the integration
6:06
application not check the integration
6:06
application not check the integration with external
6:08
with external components and the idea of create this
6:13
components and the idea of create this
6:13
components and the idea of create this kind of test is that you need to check
6:16
kind of test is that you need to check
6:16
kind of test is that you need to check all the scenarios not like the Happy
6:18
all the scenarios not like the Happy
6:18
all the scenarios not like the Happy path the success scenario where
6:20
path the success scenario where
6:20
path the success scenario where everything works the idea is okay I need
6:23
everything works the idea is okay I need
6:23
everything works the idea is okay I need to check what happen if my application
6:25
to check what happen if my application
6:25
to check what happen if my application receive a um event with a wrong format
6:29
receive a um event with a wrong format
6:29
receive a um event with a wrong format or an application or my application
6:32
or an application or my application
6:32
or an application or my application receive an event with an error what
6:34
receive an event with an error what
6:34
receive an event with an error what happened with my application which is
6:35
happened with my application which is
6:35
happened with my application which is the behavior of my application in that
6:41
context so which libraries more or less
6:45
context so which libraries more or less
6:45
context so which libraries more or less cover all these problems how I can do it
6:50
cover all these problems how I can do it
6:50
cover all these problems how I can do it in in a way that is more or less
6:52
in in a way that is more or less
6:52
in in a way that is more or less agnostic to the the the libraries or the
6:55
agnostic to the the the libraries or the
6:56
agnostic to the the the libraries or the language that I use first one test
6:58
language that I use first one test
6:58
language that I use first one test container container give me the
7:00
container container give me the
7:00
container container give me the possibility to run um different
7:04
possibility to run um different
7:04
possibility to run um different containers using Docker behind the
7:06
containers using Docker behind the
7:06
containers using Docker behind the scenes and in most of the cases is
7:09
scenes and in most of the cases is
7:09
scenes and in most of the cases is agnostic to the language that have
7:11
agnostic to the language that have
7:11
agnostic to the language that have support in different languages so for me
7:14
support in different languages so for me
7:14
support in different languages so for me it's okay I don't need uh to uh learn
7:19
it's okay I don't need uh to uh learn
7:19
it's okay I don't need uh to uh learn different libraries is just like
7:22
different libraries is just like
7:22
different libraries is just like understand how Implement on different
7:24
understand how Implement on different
7:24
understand how Implement on different languages as container but it's the same
7:27
languages as container but it's the same
7:27
languages as container but it's the same local stack in this case because it's a
7:30
local stack in this case because it's a
7:30
local stack in this case because it's a tool that simulate most of the AWS uh
7:35
tool that simulate most of the AWS uh
7:35
tool that simulate most of the AWS uh services so in the case that you use A3
7:39
services so in the case that you use A3
7:39
services so in the case that you use A3 to um like an NP to to push a file or
7:43
to um like an NP to to push a file or
7:43
to um like an NP to to push a file or use squ or NSS you can simulate the the
7:47
use squ or NSS you can simulate the the
7:47
use squ or NSS you can simulate the the behavior without need to use the real
7:51
behavior without need to use the real
7:51
behavior without need to use the real infrastructure of your company because
7:54
infrastructure of your company because
7:54
infrastructure of your company because the main problem is okay I can create a
7:57
the main problem is okay I can create a
7:57
the main problem is okay I can create a test and check uh okay and where is the
8:02
test and check uh okay and where is the
8:02
test and check uh okay and where is the the Quee of your application an know
8:04
the Quee of your application an know
8:04
the Quee of your application an know it's a real Quee on stage or develop an
8:09
it's a real Quee on stage or develop an
8:09
it's a real Quee on stage or develop an environment well perhaps your
8:13
environment well perhaps your
8:13
environment well perhaps your application locally could listen this
8:15
application locally could listen this
8:15
application locally could listen this event but at the same time some
8:18
event but at the same time some
8:18
event but at the same time some application stage could listen the same
8:21
application stage could listen the same
8:21
application stage could listen the same event and produce a bad behavior on the
8:26
event and produce a bad behavior on the
8:26
event and produce a bad behavior on the environment karate uh is a tool to write
8:30
environment karate uh is a tool to write
8:30
environment karate uh is a tool to write uh test using bdd is is a good tool to
8:34
uh test using bdd is is a good tool to
8:34
uh test using bdd is is a good tool to write in a simple way test without need
8:38
write in a simple way test without need
8:38
write in a simple way test without need to know a about the language or the
8:41
to know a about the language or the
8:41
to know a about the language or the framework that you use behind the scenes
8:44
framework that you use behind the scenes
8:44
framework that you use behind the scenes is not
8:45
is not necessar and last use uh res hat which
8:50
necessar and last use uh res hat which
8:50
necessar and last use uh res hat which is a tool that provide me access in this
8:53
is a tool that provide me access in this
8:54
is a tool that provide me access in this case to a um non relational database
8:57
case to a um non relational database
8:57
case to a um non relational database like
8:57
like mongodb Expos me like a happy rest to
9:02
mongodb Expos me like a happy rest to
9:02
mongodb Expos me like a happy rest to consume uh from different endpoints the
9:06
consume uh from different endpoints the
9:06
consume uh from different endpoints the information that exist in the database
9:08
information that exist in the database
9:08
information that exist in the database so with this kind of combination of
9:11
so with this kind of combination of
9:11
so with this kind of combination of tools or libraries you can create more
9:15
tools or libraries you can create more
9:15
tools or libraries you can create more or less a test that check
9:18
or less a test that check
9:19
or less a test that check everything uh which is connected with
9:21
everything uh which is connected with
9:21
everything uh which is connected with your application all the external
9:23
your application all the external
9:23
your application all the external Services of your
9:26
Services of your microservices okay how is the syntax of
9:29
microservices okay how is the syntax of
9:29
microservices okay how is the syntax of cor because not all the people perhaps
9:32
cor because not all the people perhaps
9:32
cor because not all the people perhaps know how this uh looks
9:35
know how this uh looks
9:35
know how this uh looks like and the idea is more or less this
9:40
like and the idea is more or less this
9:40
like and the idea is more or less this in this case I create a I put an example
9:42
in this case I create a I put an example
9:42
in this case I create a I put an example using springo springo is a framework on
9:45
using springo springo is a framework on
9:45
using springo springo is a framework on Java but it's the same the name of the
9:48
Java but it's the same the name of the
9:48
Java but it's the same the name of the feature is is like a description and you
9:52
feature is is like a description and you
9:52
feature is is like a description and you have like
9:53
have like a part or group or section of on the
9:57
a part or group or section of on the
9:57
a part or group or section of on the file where you can put all the things
9:59
file where you can put all the things
9:59
file where you can put all the things related with the background of the of
10:01
related with the background of the of
10:02
related with the background of the of your test and in the section of the
10:05
your test and in the section of the
10:05
your test and in the section of the scenario you put all the things that you
10:08
scenario you put all the things that you
10:08
scenario you put all the things that you want to do in this case I want to
10:11
want to do in this case I want to
10:11
want to do in this case I want to execute in the given section I will to
10:14
execute in the given section I will to
10:14
execute in the given section I will to execute um HTTP request using the get
10:19
execute um HTTP request using the get
10:19
execute um HTTP request using the get method and then check if the status of
10:24
method and then check if the status of
10:24
method and then check if the status of the response is 200 and the response
10:28
the response is 200 and the response
10:28
the response is 200 and the response more more or less have this format
10:32
more more or less have this format
10:32
more more or less have this format and you you don't write nothing about
10:35
and you you don't write nothing about
10:35
and you you don't write nothing about Java here or or any language or python
10:40
Java here or or any language or python
10:40
Java here or or any language or python is agnostic anyone could understand more
10:44
is agnostic anyone could understand more
10:44
is agnostic anyone could understand more or less this the this
10:50
idea and okay which are the the pros or
10:54
idea and okay which are the the pros or
10:54
idea and okay which are the the pros or the cons of using this
10:57
the cons of using this
10:57
the cons of using this approach first not affect the real
11:00
approach first not affect the real
11:00
approach first not affect the real infrastructure of your uh company the
11:03
infrastructure of your uh company the
11:03
infrastructure of your uh company the idea is to keep isolate uh your
11:07
idea is to keep isolate uh your
11:07
idea is to keep isolate uh your application with the
11:08
application with the
11:08
application with the test second you can check the endpoints
11:12
test second you can check the endpoints
11:12
test second you can check the endpoints on the database and check if the the
11:16
on the database and check if the the
11:16
on the database and check if the the modification are okay or not the content
11:20
modification are okay or not the content
11:20
modification are okay or not the content on on the database or any collection
11:22
on on the database or any collection
11:22
on on the database or any collection change or
11:24
change or not and you can simulate elent like
11:29
not and you can simulate elent like
11:29
not and you can simulate elent like producing or reception uh listen an
11:33
producing or reception uh listen an
11:33
producing or reception uh listen an event again is agnostic to the language
11:36
event again is agnostic to the language
11:36
event again is agnostic to the language you can have an application that use C
11:39
you can have an application that use C
11:39
you can have an application that use C and another one that use Java and
11:42
and another one that use Java and
11:42
and another one that use Java and another one that use go the idea is like
11:46
another one that use go the idea is like
11:46
another one that use go the idea is like create in a separate folder and do all
11:50
create in a separate folder and do all
11:50
create in a separate folder and do all this kind of configuration which I will
11:52
this kind of configuration which I will
11:52
this kind of configuration which I will show you in a couple of
11:55
show you in a couple of
11:55
show you in a couple of meetings the main problem is takes more
11:58
meetings the main problem is takes more
11:58
meetings the main problem is takes more time to be executed because uh you need
12:01
time to be executed because uh you need
12:01
time to be executed because uh you need to run different containers different
12:04
to run different containers different
12:04
to run different containers different containers of of Docker uh one to
12:08
containers of of Docker uh one to
12:08
containers of of Docker uh one to simulate the the all the infrastructure
12:10
simulate the the all the infrastructure
12:10
simulate the the all the infrastructure of AWS another one to communicate to the
12:15
of AWS another one to communicate to the
12:15
of AWS another one to communicate to the with the database and many other things
12:18
with the database and many other things
12:18
with the database and many other things so it's not like okay not run this in in
12:24
so it's not like okay not run this in in
12:24
so it's not like okay not run this in in in the same um Step imagine that you
12:27
in the same um Step imagine that you
12:27
in the same um Step imagine that you have a pipeline in the same step that
12:29
have a pipeline in the same step that
12:29
have a pipeline in the same step that you have your unit test separate in a
12:32
you have your unit test separate in a
12:32
you have your unit test separate in a different step in in the
12:34
different step in in the
12:34
different step in in the pipeline and the main problem is not all
12:38
pipeline and the main problem is not all
12:38
pipeline and the main problem is not all the database that exist have support
12:42
the database that exist have support
12:42
the database that exist have support like expose or give me a a Docker image
12:45
like expose or give me a a Docker image
12:45
like expose or give me a a Docker image that expose me um the the information
12:49
that expose me um the the information
12:49
that expose me um the the information that exist in the database for example
12:51
that exist in the database for example
12:51
that exist in the database for example there is one uh from to to use on R the
12:55
there is one uh from to to use on R the
12:55
there is one uh from to to use on R the other one with Cassandra and one with uh
13:00
other one with Cassandra and one with uh
13:00
other one with Cassandra and one with uh my SQL database but for example for
13:03
my SQL database but for example for
13:03
my SQL database but for example for Progress not exist so you need to find
13:07
Progress not exist so you need to find
13:07
Progress not exist so you need to find the correct tool in this case I will
13:09
the correct tool in this case I will
13:09
the correct tool in this case I will show you with
13:12
show you with mongodb how this process works hold
13:16
mongodb how this process works hold
13:16
mongodb how this process works hold this uh steps well
13:20
this uh steps well first the is like set the context the
13:23
first the is like set the context the
13:23
first the is like set the context the idea is that you insert or produce the
13:26
idea is that you insert or produce the
13:26
idea is that you insert or produce the event and push to a specific q and load
13:30
event and push to a specific q and load
13:30
event and push to a specific q and load all the information that you need or
13:32
all the information that you need or
13:32
all the information that you need or your application need to work in the
13:34
your application need to work in the
13:34
your application need to work in the database imagine that you need to have a
13:38
database imagine that you need to have a
13:38
database imagine that you need to have a specific role or information about one
13:41
specific role or information about one
13:41
specific role or information about one user and when you listen an event you
13:45
user and when you listen an event you
13:45
user and when you listen an event you change something in the in the row on
13:48
change something in the in the row on
13:48
change something in the in the row on the database related with that
13:51
the database related with that
13:51
the database related with that user so it's like a
13:53
user so it's like a constraint second one you execute all
13:56
constraint second one you execute all
13:56
constraint second one you execute all the
13:57
the test after that you check the results
13:59
test after that you check the results
13:59
test after that you check the results and the last
14:01
and the last part is um remove any kind of possible
14:07
part is um remove any kind of possible
14:07
part is um remove any kind of possible events because you push event and to
14:11
events because you push event and to
14:11
events because you push event and to some place imagine that you in the local
14:13
some place imagine that you in the local
14:13
some place imagine that you in the local stack simulate the real infrastructure
14:16
stack simulate the real infrastructure
14:16
stack simulate the real infrastructure or AWS so my test my one of my test push
14:21
or AWS so my test my one of my test push
14:22
or AWS so my test my one of my test push an event and I have another one which is
14:25
an event and I have another one which is
14:25
an event and I have another one which is not connected that
14:27
not connected that listen the same EV or the same Q so one
14:31
listen the same EV or the same Q so one
14:31
listen the same EV or the same Q so one test could affect another one so you
14:35
test could affect another one so you
14:35
test could affect another one so you need to remove the event each time that
14:38
need to remove the event each time that
14:38
need to remove the event each time that you finish the execution if you don't
14:41
you finish the execution if you don't
14:41
you finish the execution if you don't check if you check if the event is
14:44
check if you check if the event is
14:44
check if you check if the event is produced more or less it's the
14:47
same well here is the repository of the
14:52
same well here is the repository of the
14:52
same well here is the repository of the GitHub let me uh show you
14:59
here are more or less the the repository
15:02
here are more or less the the repository
15:02
here are more or less the the repository with the docker file and but is an
15:06
with the docker file and but is an
15:06
with the docker file and but is an application yet which you can run using
15:10
application yet which you can run using
15:10
application yet which you can run using here the docker compos but let me show
15:13
here the docker compos but let me show
15:13
here the docker compos but let me show you some little
15:15
you some little things first one the docker
15:18
things first one the docker
15:18
things first one the docker compost here I have the configuration of
15:22
compost here I have the configuration of
15:22
compost here I have the configuration of the local stack it's a simple
15:24
the local stack it's a simple
15:24
the local stack it's a simple configuration on the repository you have
15:27
configuration on the repository you have
15:27
configuration on the repository you have all the things it's like
15:30
all the things it's like
15:30
all the things it's like Docker image and only
15:34
Docker image and only
15:34
Docker image and only enable uh some Services I put the region
15:38
enable uh some Services I put the region
15:38
enable uh some Services I put the region and many other things and a bash file
15:44
and many other things and a bash file
15:44
and many other things and a bash file which uh have different functions to
15:47
which uh have different functions to
15:47
which uh have different functions to create a queue a topic or many many
15:50
create a queue a topic or many many
15:50
create a queue a topic or many many things so you can reuse it it's not just
15:53
things so you can reuse it it's not just
15:53
things so you can reuse it it's not just for this um Conference of this talk you
15:56
for this um Conference of this talk you
15:56
for this um Conference of this talk you can reuse it uh with any kind of problem
16:00
can reuse it uh with any kind of problem
16:00
can reuse it uh with any kind of problem here at the end I have the creation of
16:03
here at the end I have the creation of
16:03
here at the end I have the creation of the the the topics and list
16:08
the the the topics and list
16:08
the the the topics and list everything and in the docker file you
16:13
everything and in the docker file you
16:13
everything and in the docker file you have here the rest H and you can use it
16:17
have here the rest H and you can use it
16:17
have here the rest H and you can use it without any problem it's not just
16:19
without any problem it's not just
16:19
without any problem it's not just connected with the integration test if
16:20
connected with the integration test if
16:21
connected with the integration test if you want you can use it uh in your
16:23
you want you can use it uh in your
16:23
you want you can use it uh in your machine and configure everything to
16:26
machine and configure everything to
16:26
machine and configure everything to communicate with the the the database
16:29
communicate with the the the database
16:29
communicate with the the the database so here I have a Swagger
16:34
so here I have a Swagger
16:34
so here I have a Swagger API my application is running just to to
16:38
API my application is running just to to
16:38
API my application is running just to to show you that everything works fine and
16:41
show you that everything works fine and
16:41
show you that everything works fine and I will
16:43
I will create new uh is a APA that save the
16:47
create new uh is a APA that save the
16:47
create new uh is a APA that save the information about reservation of uh
16:49
information about reservation of uh
16:49
information about reservation of uh flights so I push new um new
16:55
flights so I push new um new
16:55
flights so I push new um new reservations and okay it's an simpl I I
16:59
reservations and okay it's an simpl I I
16:59
reservations and okay it's an simpl I I don't show you nothing
17:02
don't show you nothing
17:02
don't show you nothing new but let me show you how with uh red
17:08
new but let me show you how with uh red
17:08
new but let me show you how with uh red her you can see this is the the the port
17:14
her you can see this is the the the port
17:14
her you can see this is the the the port and the in my local host I run
17:17
and the in my local host I run
17:17
and the in my local host I run in um res her and this is the name of
17:20
in um res her and this is the name of
17:20
in um res her and this is the name of the collection so I put play
17:24
the collection so I put play
17:24
the collection so I put play reservation
17:26
reservation reservation and I he here I have all the
17:29
reservation and I he here I have all the
17:29
reservation and I he here I have all the information from my database these
17:32
information from my database these
17:32
information from my database these are uh rows from mongodb all the
17:36
are uh rows from mongodb all the
17:36
are uh rows from mongodb all the information that I have on my
17:38
information that I have on my
17:38
information that I have on my machine which okay it's great um but how
17:43
machine which okay it's great um but how
17:43
machine which okay it's great um but how I can connect all these things in
17:47
I can connect all these things in
17:47
I can connect all these things in karate and with these kind of
17:50
karate and with these kind of
17:50
karate and with these kind of things I will stop this one because I'm
17:54
things I will stop this one because I'm
17:54
things I will stop this one because I'm running an
17:57
running an application and let me show you how you
18:00
application and let me show you how you
18:00
application and let me show you how you can combine all these things uh don't
18:03
can combine all these things uh don't
18:03
can combine all these things uh don't pay attention to the the code because
18:05
pay attention to the the code because
18:05
pay attention to the the code because this is a application in Java but it's
18:09
this is a application in Java but it's
18:09
this is a application in Java but it's not the the our problem our problem is
18:13
not the the our problem our problem is
18:13
not the the our problem our problem is connected with events so let me show you
18:18
connected with events so let me show you
18:18
connected with events so let me show you how uh you can combine all these things
18:21
how uh you can combine all these things
18:21
how uh you can combine all these things karate and local stack red heart in a
18:25
karate and local stack red heart in a
18:25
karate and local stack red heart in a simple script or in a simple test
18:29
simple script or in a simple test
18:29
simple script or in a simple test let me show you this is one of my Kate
18:33
let me show you this is one of my Kate
18:33
let me show you this is one of my Kate test which simulate the same thing that
18:36
test which simulate the same thing that
18:36
test which simulate the same thing that I do create a reservation like using the
18:40
I do create a reservation like using the
18:40
I do create a reservation like using the postman or the Swagger to create a
18:42
postman or the Swagger to create a
18:42
postman or the Swagger to create a reservation to send a
18:44
reservation to send a
18:44
reservation to send a request so I say okay this is the the
18:48
request so I say okay this is the the
18:48
request so I say okay this is the the URL where you need to do the
18:52
URL where you need to do the
18:52
URL where you need to do the request after that please instead to
18:56
request after that please instead to
18:56
request after that please instead to write all the body of the request and
18:58
write all the body of the request and
18:58
write all the body of the request and the resp response it's not the idea and
19:02
the resp response it's not the idea and
19:02
the resp response it's not the idea and it's something that okay it's not
19:04
it's something that okay it's not
19:04
it's something that okay it's not necessary that I write in a test so
19:07
necessary that I write in a test so
19:07
necessary that I write in a test so please put in a file like this and read
19:10
please put in a file like this and read
19:10
please put in a file like this and read the information so I put in a separate
19:13
the information so I put in a separate
19:13
the information so I put in a separate file uh file sorry and you can see here
19:19
file uh file sorry and you can see here
19:19
file uh file sorry and you can see here it's a simple HTTP request or the body
19:22
it's a simple HTTP request or the body
19:22
it's a simple HTTP request or the body of HTTP request like appear on on open
19:26
of HTTP request like appear on on open
19:26
of HTTP request like appear on on open AI or or Swagger so I put in a separate
19:30
AI or or Swagger so I put in a separate
19:30
AI or or Swagger so I put in a separate file and say okay read the file and put
19:33
file and say okay read the file and put
19:33
file and say okay read the file and put in this
19:34
in this variable and do a HTTP request
19:39
variable and do a HTTP request
19:39
variable and do a HTTP request here and with this body with the
19:43
here and with this body with the
19:43
here and with this body with the variable that contain this body this one
19:46
variable that contain this body this one
19:46
variable that contain this body this one sorry this one with this content tyag
19:49
sorry this one with this content tyag
19:49
sorry this one with this content tyag with this method and check the status
19:51
with this method and check the status
19:51
with this method and check the status and nothing more this is more or less
19:52
and nothing more this is more or less
19:52
and nothing more this is more or less the same the same scenario I don't
19:54
the same the same scenario I don't
19:54
the same the same scenario I don't change
19:55
change nothing okay how we can do the
19:59
nothing okay how we can do the
19:59
nothing okay how we can do the combination where appear the database
20:02
combination where appear the database
20:02
combination where appear the database where I appears that that you can check
20:05
where I appears that that you can check
20:05
where I appears that that you can check if everything works fine or not remember
20:07
if everything works fine or not remember
20:07
if everything works fine or not remember that I say okay I have a
20:10
that I say okay I have a
20:10
that I say okay I have a folder call it
20:12
folder call it Docker with all this information with
20:15
Docker with all this information with
20:15
Docker with all this information with all the local stack and red heart
20:18
all the local stack and red heart
20:18
all the local stack and red heart configuration and the configuration it's
20:20
configuration and the configuration it's
20:20
configuration and the configuration it's simple you can download the from the
20:23
simple you can download the from the
20:23
simple you can download the from the official documentation and the rest
20:26
official documentation and the rest
20:26
official documentation and the rest heart and local stack and put theile
20:29
heart and local stack and put theile
20:29
heart and local stack and put theile inside and just Mount the the volumes
20:33
inside and just Mount the the volumes
20:33
inside and just Mount the the volumes with the
20:34
with the information nothing strange and I only
20:38
information nothing strange and I only
20:38
information nothing strange and I only create a simple
20:40
create a simple class here which is in Java but is the
20:44
class here which is in Java but is the
20:44
class here which is in Java but is the only code that you need to
20:46
only code that you need to
20:46
only code that you need to write which use Docker
20:49
write which use Docker
20:49
write which use Docker compose um test container sorry and run
20:52
compose um test container sorry and run
20:52
compose um test container sorry and run the docker compos file with this
20:55
the docker compos file with this
20:55
the docker compos file with this instruction it's nothing new or
20:59
instruction it's nothing new or
20:59
instruction it's nothing new or range but where is the the magic of this
21:03
range but where is the the magic of this
21:03
range but where is the the magic of this let me show you
21:05
let me show you another scenario
21:08
another scenario here let me show you this one because
21:10
here let me show you this one because
21:10
here let me show you this one because it's a combination of all these kind of
21:13
it's a combination of all these kind of
21:13
it's a combination of all these kind of things I want to create or simulate the
21:18
things I want to create or simulate the
21:18
things I want to create or simulate the a scenario where I save a reservation
21:20
a scenario where I save a reservation
21:20
a scenario where I save a reservation save something in the database and when
21:23
save something in the database and when
21:24
save something in the database and when I say something into the database my
21:26
I say something into the database my
21:26
I say something into the database my application throw or create a new event
21:30
application throw or create a new event
21:30
application throw or create a new event so I need to do different
21:35
so I need to do different
21:35
so I need to do different things okay let me first this is more or
21:39
things okay let me first this is more or
21:39
things okay let me first this is more or less the same scenario that the previous
21:42
less the same scenario that the previous
21:42
less the same scenario that the previous one is like a like a copy and
21:45
one is like a like a copy and
21:45
one is like a like a copy and paste this is payment confirm it so this
21:49
paste this is payment confirm it so this
21:49
paste this is payment confirm it so this section is the same don't
21:52
section is the same don't
21:52
section is the same don't change and
21:54
change and now I don't change nothing I don't check
21:58
now I don't change nothing I don't check
21:58
now I don't change nothing I don't check if anything it's okay or not I will
22:00
if anything it's okay or not I will
22:01
if anything it's okay or not I will create an event using local
22:03
create an event using local
22:03
create an event using local stack so I Define the body of my
22:08
stack so I Define the body of my
22:08
stack so I Define the body of my event here and there is a file here
22:12
event here and there is a file here
22:12
event here and there is a file here which is payment query this is a um um
22:17
which is payment query this is a um um
22:17
which is payment query this is a um um event that appear on
22:21
event that appear on
22:21
event that appear on AWS with the with the format it's the
22:24
AWS with the with the format it's the
22:24
AWS with the with the format it's the same I Define the the query on the the Q
22:28
same I Define the the query on the the Q
22:28
same I Define the the query on the the Q story
22:29
story and many other things so okay I create
22:33
and many other things so okay I create
22:33
and many other things so okay I create the the body of them and say to this
22:35
the the body of them and say to this
22:35
the the body of them and say to this local stack URL which I Define
22:40
local stack URL which I Define
22:40
local stack URL which I Define here and say okay throw the event send
22:44
here and say okay throw the event send
22:44
here and say okay throw the event send the event to the the
22:48
the event to the the
22:48
the event to the the infrastructure uh or the the the stack
22:50
infrastructure uh or the the the stack
22:50
infrastructure uh or the the the stack or local stack which
22:53
or local stack which
22:53
or local stack which simulate and what I want to do after
22:55
simulate and what I want to do after
22:55
simulate and what I want to do after that because okay my application
22:59
that because okay my application
22:59
that because okay my application save something into the
23:01
save something into the
23:02
save something into the database my request finish because it's
23:04
database my request finish because it's
23:04
database my request finish because it's synchronic it's like okay create an new
23:07
synchronic it's like okay create an new
23:07
synchronic it's like okay create an new event Le okay I finish what
23:10
event Le okay I finish what
23:10
event Le okay I finish what more okay well I my application is
23:14
more okay well I my application is
23:14
more okay well I my application is running and at some point of the life I
23:18
running and at some point of the life I
23:18
running and at some point of the life I send an event like this one and my
23:23
send an event like this one and my
23:23
send an event like this one and my application listen the same cu the same
23:27
application listen the same cu the same
23:27
application listen the same cu the same um the same C that this event will send
23:32
um the same C that this event will send
23:32
um the same C that this event will send it what I want to do after that well my
23:36
it what I want to do after that well my
23:36
it what I want to do after that well my application need to change something
23:39
application need to change something
23:39
application need to change something into the
23:41
into the database and what I will do with with
23:44
database and what I will do with with
23:44
database and what I will do with with this
23:45
this scenario okay I will listen the
23:49
scenario okay I will listen the
23:49
scenario okay I will listen the database until that this modification
23:54
database until that this modification
23:54
database until that this modification happen create a
23:56
happen create a reservation nothing
23:59
reservation nothing s an event my application will do
24:01
s an event my application will do
24:01
s an event my application will do something but I can check if my
24:03
something but I can check if my
24:03
something but I can check if my application is working or not because
24:05
application is working or not because
24:05
application is working or not because it's ASN
24:07
it's ASN chronic so the only way that I can check
24:11
chronic so the only way that I can check
24:11
chronic so the only way that I can check if everything it's okay or not is check
24:14
if everything it's okay or not is check
24:14
if everything it's okay or not is check the database instead to check what
24:17
the database instead to check what
24:17
the database instead to check what happened in the my application I will
24:19
happened in the my application I will
24:19
happened in the my application I will check what happened into the
24:21
check what happened into the
24:21
check what happened into the database and remember that I show you
24:25
database and remember that I show you
24:25
database and remember that I show you the a simple
24:27
the a simple HTTP uh um request to access to my
24:30
HTTP uh um request to access to my
24:30
HTTP uh um request to access to my mongodb database okay I will do the same
24:35
mongodb database okay I will do the same
24:35
mongodb database okay I will do the same and I will retry many times 10
24:40
and I will retry many times 10
24:40
and I will retry many times 10 times uh with an interval of three
24:44
times uh with an interval of three
24:44
times uh with an interval of three seconds each interval to check if
24:47
seconds each interval to check if
24:47
seconds each interval to check if something change into my
24:52
database and I read the final solution
24:56
database and I read the final solution
24:56
database and I read the final solution or the my status that the status of the
25:00
or the my status that the status of the
25:00
or the my status that the status of the database that I want to be there and at
25:05
database that I want to be there and at
25:05
database that I want to be there and at the last verification I will check if uh
25:11
the last verification I will check if uh
25:11
the last verification I will check if uh the message if my application produce
25:14
the message if my application produce
25:14
the message if my application produce some message and if my application
25:16
some message and if my application
25:16
some message and if my application produces some message which is this this
25:19
produces some message which is this this
25:19
produces some message which is this this is the case okay I will remove it
25:23
is the case okay I will remove it
25:23
is the case okay I will remove it remember that my test Co affect another
25:26
remember that my test Co affect another
25:26
remember that my test Co affect another ones that are part part of
25:30
ones that are part part of
25:30
ones that are part part of um of this
25:32
um of this set and how I can run this let me stop
25:38
set and how I can run this let me stop
25:38
set and how I can run this let me stop this all the things in my case it's like
25:41
this all the things in my case it's like
25:41
this all the things in my case it's like with NBN test because it's a you need to
25:45
with NBN test because it's a you need to
25:45
with NBN test because it's a you need to create to run karate or to use karate
25:48
create to run karate or to use karate
25:48
create to run karate or to use karate you need to use uh Java but is the only
25:52
you need to use uh Java but is the only
25:52
you need to use uh Java but is the only way to run karate not have support but
25:56
way to run karate not have support but
25:56
way to run karate not have support but in in with this scenario you can run
25:59
in in with this scenario you can run
25:59
in in with this scenario you can run test in in agnostic way it's for me the
26:03
test in in agnostic way it's for me the
26:03
test in in agnostic way it's for me the API I run this with this approach with
26:06
API I run this with this approach with
26:06
API I run this with this approach with apis that use python or go or any kind
26:10
apis that use python or go or any kind
26:10
apis that use python or go or any kind of language without any kind of problems
26:12
of language without any kind of problems
26:12
of language without any kind of problems so the idea is more or less that without
26:15
so the idea is more or less that without
26:15
so the idea is more or less that without need to know nothing about Java because
26:18
need to know nothing about Java because
26:18
need to know nothing about Java because all these things are not connected with
26:20
all these things are not connected with
26:20
all these things are not connected with Java is is a simple
26:24
Java is is a simple syntax uh you only need to know
26:26
syntax uh you only need to know
26:26
syntax uh you only need to know different tools and K give you the
26:30
different tools and K give you the
26:30
different tools and K give you the possibility to combine all of them in in
26:33
possibility to combine all of them in in
26:33
possibility to combine all of them in in a simple way my test works and
26:37
a simple way my test works and
26:37
a simple way my test works and everything it's
26:40
everything it's okay so it's complex I don't I perhaps
26:43
okay so it's complex I don't I perhaps
26:43
okay so it's complex I don't I perhaps it's if the first time that you listen
26:46
it's if the first time that you listen
26:46
it's if the first time that you listen about karate rot local stock test
26:48
about karate rot local stock test
26:48
about karate rot local stock test container perhap is so complex but the
26:51
container perhap is so complex but the
26:52
container perhap is so complex but the idea is of this talk that you see that
26:54
idea is of this talk that you see that
26:54
idea is of this talk that you see that it's possible to combine all these kind
26:57
it's possible to combine all these kind
26:57
it's possible to combine all these kind of things in a simple test in a simple
27:01
of things in a simple test in a simple
27:01
of things in a simple test in a simple um set of of verification of your
27:04
um set of of verification of your
27:04
um set of of verification of your application and if you write one of
27:07
application and if you write one of
27:07
application and if you write one of these test which combine different
27:09
these test which combine different
27:09
these test which combine different things you can do the same uh many times
27:13
things you can do the same uh many times
27:13
things you can do the same uh many times you can provide this uh template more or
27:16
you can provide this uh template more or
27:16
you can provide this uh template more or less to any person and any person that
27:20
less to any person and any person that
27:20
less to any person and any person that more or less knows something about these
27:23
more or less knows something about these
27:23
more or less knows something about these kind of things Co create their own test
27:26
kind of things Co create their own test
27:26
kind of things Co create their own test I don't know a business analyst or a
27:29
I don't know a business analyst or a
27:29
I don't know a business analyst or a developer or a technical leader like
27:32
developer or a technical leader like
27:32
developer or a technical leader like me
27:34
me so let me finish my
27:39
presentation best practices about this
27:42
presentation best practices about this
27:43
presentation best practices about this first check
27:44
first check everything because you have a
27:46
everything because you have a
27:46
everything because you have a asynchronic event so you need to check
27:49
asynchronic event so you need to check
27:49
asynchronic event so you need to check if the events and the database suffer
27:52
if the events and the database suffer
27:52
if the events and the database suffer some kind of modifications is not like
27:56
some kind of modifications is not like
27:56
some kind of modifications is not like okay I will only check if the event uh
28:01
okay I will only check if the event uh
28:01
okay I will only check if the event uh will produce for my application or not
28:04
will produce for my application or not
28:04
will produce for my application or not the idea is that you check if the
28:07
the idea is that you check if the
28:07
the idea is that you check if the modification appearing to the
28:09
modification appearing to the
28:09
modification appearing to the database because you don't have the
28:11
database because you don't have the
28:11
database because you don't have the possibility to say h uh if something bad
28:15
possibility to say h uh if something bad
28:15
possibility to say h uh if something bad happen on my application I will receive
28:18
happen on my application I will receive
28:18
happen on my application I will receive a a bad request no perhaps in Mons of
28:22
a a bad request no perhaps in Mons of
28:22
a a bad request no perhaps in Mons of the application that listen event this
28:24
the application that listen event this
28:24
the application that listen event this is not possible so check the database
28:28
is not possible so check the database
28:28
is not possible so check the database and remove all EV after that you
28:33
and remove all EV after that you
28:33
and remove all EV after that you create a new scenario and this is
28:36
create a new scenario and this is
28:36
create a new scenario and this is scenario produce event or application
28:39
scenario produce event or application
28:39
scenario produce event or application produce
28:40
produce event try to uh remove it in the case
28:46
event try to uh remove it in the case
28:46
event try to uh remove it in the case that will affect other other test right
28:50
that will affect other other test right
28:50
that will affect other other test right simple like uh as I show you my karate
28:54
simple like uh as I show you my karate
28:54
simple like uh as I show you my karate test don't say nothing about Java or
28:57
test don't say nothing about Java or
28:57
test don't say nothing about Java or anything language is is agnostic anyone
29:01
anything language is is agnostic anyone
29:01
anything language is is agnostic anyone Co understand uh is is using simple
29:04
Co understand uh is is using simple
29:04
Co understand uh is is using simple words and try to externalize all the
29:08
words and try to externalize all the
29:08
words and try to externalize all the things all the the bodies of the request
29:10
things all the the bodies of the request
29:11
things all the the bodies of the request or the query message or the request or
29:14
or the query message or the request or
29:14
or the query message or the request or the body sorry of the the message that
29:16
the body sorry of the the message that
29:16
the body sorry of the the message that you want to send is a way that anyone
29:20
you want to send is a way that anyone
29:20
you want to send is a way that anyone could understand the idea of the test
29:23
could understand the idea of the test
29:23
could understand the idea of the test and use container try to create um a
29:27
and use container try to create um a
29:27
and use container try to create um a Docker compos file which simulate all
29:30
Docker compos file which simulate all
29:30
Docker compos file which simulate all the real infrastructure and connect with
29:33
the real infrastructure and connect with
29:33
the real infrastructure and connect with test
29:33
test container which have support on
29:36
container which have support on
29:36
container which have support on different languages so if you replace
29:40
different languages so if you replace
29:40
different languages so if you replace karate for another another framework you
29:43
karate for another another framework you
29:43
karate for another another framework you can you reuse any of these things in in
29:46
can you reuse any of these things in in
29:46
can you reuse any of these things in in any language in fact I use this approach
29:50
any language in fact I use this approach
29:50
any language in fact I use this approach to change from one framework to another
29:53
to change from one framework to another
29:53
to change from one framework to another or rewrite my one entire microservices
29:57
or rewrite my one entire microservices
29:57
or rewrite my one entire microservices without any kind of problem
29:59
without any kind of problem
29:59
without any kind of problem so H this is the the the main goal of
30:02
so H this is the the the main goal of
30:02
so H this is the the the main goal of the talk additional resources there are
30:05
the talk additional resources there are
30:05
the talk additional resources there are some books which provide you more
30:08
some books which provide you more
30:08
some books which provide you more information about different things like
30:10
information about different things like
30:10
information about different things like what is bdd because I I think if you
30:14
what is bdd because I I think if you
30:14
what is bdd because I I think if you don't work with the bdd perhaps you say
30:17
don't work with the bdd perhaps you say
30:17
don't work with the bdd perhaps you say what is this and there is another one
30:20
what is this and there is another one
30:20
what is this and there is another one which is testing web API which provide
30:23
which is testing web API which provide
30:23
which is testing web API which provide information not just how to create a
30:25
information not just how to create a
30:25
information not just how to create a test it's like thinking on different
30:27
test it's like thinking on different
30:27
test it's like thinking on different things
30:28
things about a test like okay what happened
30:30
about a test like okay what happened
30:30
about a test like okay what happened with the database what happened with
30:32
with the database what happened with
30:32
with the database what happened with events what happened with an endtoend
30:35
events what happened with an endtoend
30:35
events what happened with an endtoend test how I can
30:37
test how I can check my entire infrastructure or how I
30:40
check my entire infrastructure or how I
30:40
check my entire infrastructure or how I can run the test in a pipeline without
30:42
can run the test in a pipeline without
30:42
can run the test in a pipeline without affecting all
30:44
affecting all microservices and at the end I have I
30:47
microservices and at the end I have I
30:47
microservices and at the end I have I put some uh books about the the idea of
30:50
put some uh books about the the idea of
30:50
put some uh books about the the idea of event in the case that you don't have
30:53
event in the case that you don't have
30:53
event in the case that you don't have experience uh using event uh on your
30:56
experience uh using event uh on your
30:56
experience uh using event uh on your microservices
30:58
microservices some blocks
31:00
some blocks to and go in deep in some terms that I
31:03
to and go in deep in some terms that I
31:03
to and go in deep in some terms that I mentioned during the during my
31:06
mentioned during the during my
31:06
mentioned during the during my talk and that is all thank you for uh
31:10
talk and that is all thank you for uh
31:10
talk and that is all thank you for uh coming to this talk