File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
src/test/java/net/apispark/webapi Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ package net .apispark .webapi ;
2
+
3
+ import org .junit .Assert ;
4
+ import org .junit .Test ;
5
+
6
+ import net .apispark .webapi .db .ContactPersistence ;
7
+ import net .apispark .webapi .representation .Contact ;
8
+
9
+ public class ContactPersistenceTest {
10
+ @ Test
11
+ public void addContactTest () throws Exception {
12
+ ContactPersistence contactPersistence = new ContactPersistence ();
13
+ Contact contact = new Contact ();
14
+ Contact createdContact = contactPersistence .addContact (contact );
15
+ Assert .assertNotNull (createdContact .getId ());
16
+ Assert .assertEquals (createdContact , contact );
17
+ }
18
+
19
+ @ Test
20
+ public void requestNewContactTest () throws Exception {
21
+ ContactPersistence contactPersistence = new ContactPersistence ();
22
+ Contact contact = new Contact ();
23
+ Contact createdContact = contactPersistence .addContact (contact );
24
+ Assert .assertEquals (contactPersistence .getContact (createdContact .getId ()), createdContact );
25
+ }
26
+
27
+
28
+ }
You can’t perform that action at this time.
0 commit comments