Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Update 07.md #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/07.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In a Spring-based application there are only a few changes to this simple layout
* instead of using the regular `JUnit4` runner class a special `SpringJUnit4ClassRunner` is used so that Spring can do the necessary bootstrapping (e.g. loading the application context) and provide the Dependency Injection features (for more details please refer to [this documentation](http://static.springsource.org/spring/docs/2.5.6/reference/testing.html#testcontext-junit4-runner).)
* we need to provide a reference to our application context configuration via the `@ContextConfiguration` annotation at class level.

That's it! With that we have a template to execute unit tests and benefit from all the Spring framework features. Let's have a look at the (skeleton of the) unit test we created for the [ContactDAO](https://github.com/SAP/cloud-enterprise-granny/blob/master/src/main/java/com/sap/hana/cloud/samples/granny/dao/ContactDAOImpl.java) class:
That's it! With that we have a template to execute unit tests and benefit from all the Spring framework features. Let's have a look at the (skeleton of the) unit test we created for the [ContactDAO](https://github.com/SAP/cloud-enterprise-granny/blob/master/enterprise-granny-service/src/main/java/com/sap/hana/cloud/samples/granny/dao/ContactDAOImpl.java) class:

```java
package com.sap.hana.cloud.samples.granny.dao;
Expand Down Expand Up @@ -101,7 +101,7 @@ public class TestContactDAO
}
}
```
(The complete source can be found [here](https://github.com/SAP/cloud-enterprise-granny/blob/master/src/test/java/com/sap/hana/cloud/samples/granny/dao/TestContactDAO.java).)
(The complete source can be found [here](https://github.com/SAP/cloud-enterprise-granny/blob/master/enterprise-granny-service/src/test/java/com/sap/hana/cloud/samples/granny/dao/TestContactDAO.java).)

Let's discuss a couple of note-worthy things in the following sub-chapters...

Expand Down Expand Up @@ -161,7 +161,7 @@ Here, we have defined our test case for the CRUD operations. In order to flag it

#### OptimisticLocking Test (Lines 29, 30)

This unit test verifies that the OptimisticLocking approach we implemented in [chapter 5](/05.md). To mimic a situation of a concurrent access I have omitted the `@Transactional` annotation on purpose.
This unit test verifies that the OptimisticLocking approach we implemented in [chapter 5](https://github.com/SAP/cloud-enterprise-granny/blob/master/doc/05.md). To mimic a situation of a concurrent access I have omitted the `@Transactional` annotation on purpose.

### Wrap-up

Expand Down