use of org.codice.ddf.persistence.attributes.AttributesStore in project ddf by codice.
the class TestDataUsage method setUp.
@Before
public void setUp() throws PersistenceException {
attributesStore = mock(AttributesStore.class);
persistentStore = mock(PersistentStore.class);
userList = generateUserList();
when(attributesStore.getAllUsers()).thenReturn(userList);
doAnswer((InvocationOnMock invocationOnMock) -> {
Object[] args = invocationOnMock.getArguments();
String user = (String) args[0];
long dataUsage = (long) args[1];
for (Map<String, Object> map : userList) {
if (map.get(USER_TXT).equals(user)) {
map.put(DATA_LIMIT, dataUsage);
}
}
return null;
}).when(attributesStore).setDataLimit(anyString(), anyLong());
dataUsage = new DataUsage(attributesStore, persistentStore);
}
Aggregations