Skip to content

rubenskj/test-driven-development

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning Test Driven Development

This is basically for study, the idea was learn about tdd and start code that way. Then use in inside projects of HBSIS.

Getting Started

At first, we need to write a test to return a httpstatus of 404. Then we start to create our controller.

Image getting exception 404

Here comes how to test the not found exception.

Treating not found exception

And thats basically the idea. First make the test, and start to develop your application


Testing each line of code.

CarService

Some issues

The 'CarWebTestClientTest' is used to test the controller directly with spring security. If the application doesn't have spring security dependency, is not necessary to wrote this peace of test.

CarWebTestClientTest

The final results

Coding like this way, make us test each line of code and make sure that is all tested and implemented.

Project structure after doing tdd

ps: That is a small project, but starting with the tests, in the future will help to maintain the code clean and tested.

About

This is basically for study, the idea was learning about tdd and start code that way

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages