@Test public void testGetDataLimit() throws PersistenceException { attributesList = new ArrayList<>(); Map<String, Object> attributes = new HashMap<>(); attributes.put(DATA_USAGE_LONG, LONG_2); attributes.put(DATA_LIMIT_LONG, LONG_1); attributesList.add(attributes); when(persistentStore.get(anyString(), anyString())).thenReturn(attributesList); long usage = attributesStore.getDataLimitByUser(USER); assertThat(usage, is(LONG_1)); }
@Test(expected = PersistenceException.class) public void testGetDataLimitNullUsername() throws PersistenceException { attributesStore.getDataLimitByUser(null); }