How it is done is as important as having it done
A person is defined by its NAME
In uppercase
Without digits
Any piece of code is guilty unless proven otherwise !
JUnit


@Test
public void shouldGetFeatureFromService() {
FeaturesService service = mock(FeaturesService.class);
RoleExpressionParser parser = mock(RoleExpressionParser.class);
Feature defaultFeature = defaultFeature();
FeaturesController controller =
new FeaturesController(service, parser);
when(service.getFeature(anyString())).thenReturn(defaultFeature);
ResponseEntity<Feature> result = controller.getFeature("hello");
verify(service).getFeature(eq("hello"));
assertThat(result.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(result.getBody())
.isEqualToComparingFieldByField(defaultFeature);
}
Think & Write a new Test case
Red - Assert new Test fails
Green - Write the code to make new Test pass
Green - Assert all Tests pass
Refactor / Clean code
Repeat

Let's try it !
A person is defined by its NAME
In uppercase
Without digits
Dependencies between test cases (order, state, ...)
Testing implementation details (test only what is exposed)
Testing other components (other classes, libraries, ...)
Slow running tests
A.T.D.D. / B.D.D
Integration tests
E2E Tests
Performance tests
Ramp-up
Peaks
Limits
...
Let's code in T.D.D. !