Skip to content

Commit

Permalink
Rename getNodesForTimestamp in getNodesAt
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Mar 11, 2022
1 parent 359449e commit c086bfa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Map<Long, Map<LwM2mPath, LwM2mNode>> getTimestampedNodes() {
*
* @return map of {@link LwM2mPath}-{@link LwM2mNode} or null if there is no value for asked timestamp.
*/
public Map<LwM2mPath, LwM2mNode> getNodesForTimestamp(Long timestamp) {
public Map<LwM2mPath, LwM2mNode> getNodesAt(Long timestamp) {
return timestampedPathNodesMap.get(timestamp);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void should_getPathNodesMapForTimestamp_pick_specific_timestamp_nodes() {
TimestampedLwM2mNodes tsNodes = getExampleTimestampedLwM2mNodes();

// when
Map<LwM2mPath, LwM2mNode> tsNodesMap = tsNodes.getNodesForTimestamp(123L);
Map<LwM2mPath, LwM2mNode> tsNodesMap = tsNodes.getNodesAt(123L);

// then
assertNotNull(tsNodesMap);
Expand All @@ -47,7 +47,7 @@ public void should_getPathNodesMapForTimestamp_pick_null_timestamp_nodes() {
TimestampedLwM2mNodes tsNodes = getExampleMixedTimestampLwM2mNodes();

// when
Map<LwM2mPath, LwM2mNode> tsNodesMap = tsNodes.getNodesForTimestamp(null);
Map<LwM2mPath, LwM2mNode> tsNodesMap = tsNodes.getNodesAt(null);

// then
assertNotNull(tsNodesMap);
Expand All @@ -61,7 +61,7 @@ public void should_getPathNodesMapForTimestamp_returns_null_for_nonexistent_time
TimestampedLwM2mNodes tsNodes = getExampleTimestampedLwM2mNodes();

// when
Map<LwM2mPath, LwM2mNode> tsNodesMap = tsNodes.getNodesForTimestamp(0L);
Map<LwM2mPath, LwM2mNode> tsNodesMap = tsNodes.getNodesAt(0L);

// then
assertNull(tsNodesMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void server_handle_multiple_timestamped_node() throws InterruptedExceptio
assertEquals(exampleNodes.keySet(), data.getTimestamps());

for (Long ts : exampleNodes.keySet()) {
Map<LwM2mPath, LwM2mNode> pathNodeMap = data.getNodesForTimestamp(ts);
Map<LwM2mPath, LwM2mNode> pathNodeMap = data.getNodesAt(ts);
assertTrue(pathNodeMap.containsKey(getExamplePath()));

LwM2mNode node = pathNodeMap.get(getExamplePath());
Expand Down

0 comments on commit c086bfa

Please sign in to comment.