1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.social.webNotification.service.test;
18
19 import java.util.ArrayList;
20 import java.util.HashMap;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.exoplatform.commons.api.notification.model.NotificationInfo;
25 import org.exoplatform.commons.api.notification.model.WebNotificationFilter;
26 import org.exoplatform.commons.api.notification.service.storage.WebNotificationStorage;
27
28
29
30
31
32
33
34 public class MockWebNotificationStorage implements WebNotificationStorage {
35
36 private Map<String, NotificationInfo> map = new HashMap<String, NotificationInfo>();
37
38 public Map<String, NotificationInfo> getMap() {
39 return this.map;
40 }
41
42 @Override
43 public void save(NotificationInfo notification) {
44 this.map.put(notification.getId(), notification);
45 }
46
47 @Override
48 public void update(NotificationInfo notification, boolean moveTop) {
49
50
51 }
52
53 @Override
54 public void markRead(String notificationId) {
55
56
57 }
58
59 @Override
60 public void markAllRead(String userId) {
61
62
63 }
64
65 @Override
66 public void hidePopover(String notificationId) {
67
68
69 }
70
71 @Override
72 public List<NotificationInfo> get(WebNotificationFilter filter, int offset, int limit) {
73 return new ArrayList<NotificationInfo>(this.map.values());
74 }
75
76 @Override
77 public NotificationInfo get(String notificationId) {
78 return this.map.get(notificationId);
79 }
80
81 @Override
82 public boolean remove(String notificationId) {
83 if (notificationId == null) {
84 this.map.clear();
85 } else {
86 this.map.remove(notificationId);
87 }
88 return false;
89 }
90
91 @Override
92 public boolean remove(String userId, long seconds) {
93
94 return false;
95 }
96
97 @Override
98 public NotificationInfo getUnreadNotification(String pluginId, String activityId, String owner) {
99
100 return null;
101 }
102
103 @Override
104 public int getNumberOnBadge(String userId) {
105
106 return 0;
107 }
108
109 @Override
110 public void resetNumberOnBadge(String userId) {
111
112
113 }
114
115 @Override
116 public boolean remove(long seconds) {
117
118 return false;
119 }
120 }