Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Test-Driven Java Development

You're reading from   Test-Driven Java Development Invoke TDD principles for end-to-end application development with Java

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781783987429
Length 284 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (12) Chapters Close

Preface 1. Why Should I Care for Test-driven Development? 2. Tools, Frameworks, and Environments FREE CHAPTER 3. Red-Green-Refactor – from Failure through Success until Perfection 4. Unit Testing – Focusing on What You Do and Not on What Has Been Done 5. Design – If It's Not Testable, It's Not Designed Well 6. Mocking – Removing External Dependencies 7. BDD – Working Together with the Whole Team 8. Refactoring Legacy Code – Making it Young Again 9. Feature Toggles – Deploying Partially Done Features to Production 10. Putting It All Together Index

A Feature Toggle example


Here we go with our demo application. This time, we're going to build a simple and small REST service to compute on demand a concrete Nth position of Fibonacci's sequence. We will keep track of enabled/disabled features using a file. For simplicity, we will use spring-boot as our framework of choice and Thymeleaf as a template engine. This is also included in the spring-boot dependency. Find more information about spring-boot and related projects at http://projects.spring.io/spring-boot/. Also, you can visit http://www.thymeleaf.org/ to read more about the template engine.

This is how the build.gradle file looks like:

apply plugin: 'java'
apply plugin: 'application'

sourceCompatibility = 1.8
version = '1.0'
mainClassName = "com.packtpublishing.tddjava.ch09.Application"

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile group: 'org.springframework.boot',
            name: 'spring-boot-starter-thymeleaf',
            version: '1.2.4.RELEASE...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image