Unit Testing RESTful APIs with TDD and Golang with Docker



Unit Testing RESTful APIs with TDD and Golang with Docker

Unit Testing RESTful APIs with TDD and Golang with Docker

A golang tutorial on test driven development for RESTful API.

This is an extension to a prior article on Building APIs with Golang + Docker found here: https://medium.com/code-uncomplicated/building-apis-in-go-beyond-hello-world-5d501d6403de

Unit Tests at the API level are often overlooked, however it’s essential to have those tests in place to catch bugs early on and facilitate confident refactoring.

Source Code: https://github.com/oliversavio/youtube-vid-code/tree/unit-test/go-api-starter

00:00 – Intro
00:42 – GoFiber Examples
02:22 – Refactor Code to make it Unit Test friendly
03:53 – Refactoring Walk-through
05:13 – Add an API Unit Test
08:46 – Unit Test walk-through
11:40 – Create a Service / Business Logic layer
13:21 – Unit Test for Service / Business Logic layer
15:55 – Add a Mock implementation
17:37 – Unit Test walk-through
20:49 – Closing thoughts

—————–
Support
—————–
Buy me a coffee: https://www.buymeacoffee.com/4xdMY36Ek
—————–
Blogs
—————–
Personal: http://olivermascarenhas.com/
Medium: https://medium.com/code-uncomplicated/
———————-
Mentoring
———————-
Find me on Code Mentor and book a 1:1 Mentoring Session
https://www.codementor.io/@oliversavio?refer=badge
—————–
Social
—————–
Twitter: https://twitter.com/olly0808/
LinkedIn: https://www.linkedin.com/in/olivermascarenhas/

#golang #docker #microservices #restfulapi #programming #tdd

Comments are closed.