Skip to content

cbfacademy/tdd-java-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Starter

Java Language JVM Platform JUnit5 Testing Framework Maven Dependency Manager

A kata starter project (skeleton) to practice test-driven development.

This short guide describes:

Prerequisites

This starter project uses the Java programming language.

Before getting started, ensure you have Java 17 LTS (or higher) installed locally. The following commands should output the version of Java installed.

$ javac -version

javac 17.0.4
$ java -version

openjdk version "17.0.4" 2022-07-19 LTS
OpenJDK Runtime Environment Zulu17.36+13-CA (build 17.0.4+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.36+13-CA (build 17.0.4+8-LTS, mixed mode, sharing)

If you do not have Java installed, a few options are available:

Oracle

Follow the JDK installation guide on the Oracle website.

SdkMan

If you are using a Unix based system, we recommend using the SdkMan tool for managing software development kits. Once the SdkMan tool installed, follow the instructions on this page to install the JDK 17.

Installation

To use this starter project:

  • Click on the Use this template button
  • Fill out the details of your new project
  • Then click on Create repository from template

Create repository from template

Development

Clone your repository

Once your new repository created, clone it locally:

  • replace ${your-username} with your GitHub username
  • replace ${repository-name} with the repository name you created above
git clone [email protected]:${your-username}/${repository-name}.git
cd ${repository-name}

Install dependencies

Next, install the project dependencies and validate your project by running the following command at the root of your project:

./mvnw clean validate

If you are on a Windows machine, that will be:

mvnw clean validate

You should see the following console output:

$ ./mvnw clean validate

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------< com.codingblackfemales:shopping-basket-kata >---------------
[INFO] Building shopping-basket-kata 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ shopping-basket-kata ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.155 s
[INFO] Finished at: 2022-09-14T00:43:32+01:00
[INFO] ------------------------------------------------------------------------

Example

In my case, the above steps would look like the following:

git clone [email protected]:SolangeUG/shopping-basket-kata.git
cd shopping-basket-kata
./mvnw clean validate

Next steps

Once the project setup completed:

  • update the description of your repository to match that of the kata
  • update the artifactId, and the project name in the pom.xml file to match the name of the kata
  • execute the following command to run tests
./mvnw clean test

Enjoy working on your kata! 😃

About

Kata starter project (JDK, Java, JUnit5)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages