1 00:00:01,700 --> 00:00:04,370 We've now finished up our first post service. 2 00:00:04,430 --> 00:00:06,160 It's time to now test this thing out. 3 00:00:06,380 --> 00:00:10,400 Now later on INSIDE the course we're going to eventually start to write some automated tests to make 4 00:00:10,400 --> 00:00:13,240 sure that all of our services work as expected. 5 00:00:13,250 --> 00:00:17,750 This is a really important aspect of micros services and we're going to go into great detail on it over 6 00:00:17,750 --> 00:00:18,580 time. 7 00:00:18,580 --> 00:00:23,490 But for this very first service we're gonna test it out manually to test out our service manually. 8 00:00:23,510 --> 00:00:26,420 We're going to use a very simple API client. 9 00:00:26,420 --> 00:00:32,950 So I'm going to go to post man dot com and find the postman API client Tester. 10 00:00:32,960 --> 00:00:38,210 Now this is a very small desktop application that you can use to make arbitrary API requests to any 11 00:00:38,210 --> 00:00:40,140 given endpoint. 12 00:00:40,170 --> 00:00:44,760 We're going to use postmen to test out this personal service or to do that we put together just to save 13 00:00:44,760 --> 00:00:46,340 ourselves a little bit of time. 14 00:00:46,410 --> 00:00:49,820 If you do not want to download and install post van that's totally OK. 15 00:00:49,830 --> 00:00:54,900 This step is really optional I just want to make sure that our services are working as expected to go 16 00:00:54,900 --> 00:00:56,340 ahead and download the application. 17 00:00:56,340 --> 00:00:57,990 If you have not already. 18 00:00:57,990 --> 00:01:02,550 Once you download the app you can open it up and you'll see a window like this right here. 19 00:01:03,460 --> 00:01:08,680 Inside of this window we're going to open up a new tab on the top left hand side and we'll customize 20 00:01:08,710 --> 00:01:12,560 a request that we're going to issue to our post API. 21 00:01:12,590 --> 00:01:16,800 I'm going to first get started by attempting to create a new post so I'll change the method. 22 00:01:16,800 --> 00:01:24,310 Other requests we're going to make to post and I'll make a request to a local host offline 4000 slash 23 00:01:24,310 --> 00:01:32,770 posts I'll then go to the headers Tab I'm going to specify a header here with a key of content dash 24 00:01:32,890 --> 00:01:37,050 type I'll give that a value of application. 25 00:01:37,110 --> 00:01:43,560 Jason and then of course we need to add in a body to the request and specify the title of the post we're 26 00:01:43,560 --> 00:01:50,280 trying to make log over to the body Tab I'm going to select raw and I'll make sure that over here on 27 00:01:50,280 --> 00:01:53,360 the right hand side at this dropdown is set to Jason. 28 00:01:53,780 --> 00:01:59,490 We're then going to write out a little bit of Jason data to send to our API we'll put down a set of 29 00:01:59,490 --> 00:02:02,100 curly braces. 30 00:02:02,230 --> 00:02:06,710 I'm going to put in a key inside of double quotes because this is Jason we're writing right here not 31 00:02:06,710 --> 00:02:08,110 javascript code. 32 00:02:08,210 --> 00:02:14,340 I'll give it a title of first post like so once I've got that all put together. 33 00:02:14,340 --> 00:02:18,150 I'll then send the request off and then down here at the bottom. 34 00:02:18,150 --> 00:02:24,420 I should see a status and a response of to a one created and I should see the I.D. and title of the 35 00:02:24,420 --> 00:02:25,410 post that we just made. 36 00:02:26,120 --> 00:02:26,400 OK. 37 00:02:26,430 --> 00:02:28,440 So it looks pretty good. 38 00:02:28,570 --> 00:02:29,880 Now let's do another quick test. 39 00:02:29,880 --> 00:02:33,450 We're going to make sure that we can retrieve all the posted have been created. 40 00:02:33,570 --> 00:02:37,430 So I'm going to make a new tab inside of postman. 41 00:02:37,540 --> 00:02:42,530 I'll make sure that I'm going to make a get request while entering a request you are out of look close 42 00:02:42,530 --> 00:02:45,390 to 4000 such posts. 43 00:02:45,530 --> 00:02:58,170 I'll go to headers I'll put in content type of application Jason and then in this case because we're 44 00:02:58,170 --> 00:03:01,230 making a get request no body required. 45 00:03:01,230 --> 00:03:03,200 Let's go ahead and send it right away. 46 00:03:03,510 --> 00:03:04,080 And there we go. 47 00:03:04,110 --> 00:03:09,350 So we can now see our posts coming back to us in the form of one big giant object. 48 00:03:09,360 --> 00:03:13,620 Let's say this thing it looks like it's working correctly now as a quick reminder if we make any change 49 00:03:13,620 --> 00:03:17,970 to our code inside of our project that's going to restart our server and because we are storing all 50 00:03:17,970 --> 00:03:21,570 of our posts in memory all of our post will be automatically dumped. 51 00:03:21,600 --> 00:03:26,760 If I go back over to my editor right now and I just add and say some comment right here and save the 52 00:03:26,760 --> 00:03:31,650 file I've now restarted my server automatically because we're making is some node man. 53 00:03:31,680 --> 00:03:36,010 So if I go back over to postman and make another get request I will no longer have any posts. 54 00:03:36,030 --> 00:03:39,720 So just something to be aware of at some point time if you make any change you're going to start to 55 00:03:39,720 --> 00:03:42,180 dump a lot of data OK. 56 00:03:42,220 --> 00:03:46,930 So I'd say that our postal service is working correctly now we're not going to do a lot of testing like 57 00:03:46,930 --> 00:03:48,280 this throughout the course. 58 00:03:48,520 --> 00:03:53,160 Manual testing is what I mean we are can do a lot of testing automated testing. 59 00:03:53,350 --> 00:03:54,670 So we're going to now take a break. 60 00:03:54,670 --> 00:03:55,900 We're going to come back next video. 61 00:03:55,900 --> 00:03:58,370 We're gonna start to put together our comment service. 62 00:03:58,370 --> 00:04:02,170 Now I'm probably going to leave it to you to do a test with post man really quickly to make sure their 63 00:04:02,170 --> 00:04:04,260 comment service works as expected as well.