Skip to content

Commit

Permalink
chore(lambda): Adds more tests for LambdaCachingAgentTest. (#5469)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
rvazquezglez and mergify[bot] committed Aug 23, 2021
1 parent 643dca2 commit 6427be7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Expand Up @@ -226,7 +226,7 @@ public CacheResult loadData(ProviderCache providerCache) {
return new DefaultCacheResult(cacheResults, evictions);
}

private void buildCacheData(
void buildCacheData(
Map<String, CacheData> lambdaCacheData,
Map<String, Collection<String>> appLambdaRelationships,
List<Map<String, Object>> allLambdas) {
Expand Down
Expand Up @@ -121,4 +121,19 @@ public void shouldNotEvictionNewData() {
.isNotEqualTo(
Keys.getLambdaFunctionKey(netflixAmazonCredentials.getName(), REGION, "function-1"));
}

@Test
public void buildCacheDataShouldAddInfo() {
HashMap<String, CacheData> lambdaCacheData = new HashMap<>();
HashMap<String, Collection<String>> appLambdaRelationships = new HashMap<>();
List<Map<String, Object>> allLambdas =
List.of(
Map.of("functionName", "appName-functionName-something"),
Map.of("functionName", "appName2-functionName2-something2"));

lambdaCachingAgent.buildCacheData(lambdaCacheData, appLambdaRelationships, allLambdas);

assertThat(lambdaCacheData.size()).isEqualTo(2);
assertThat(appLambdaRelationships.size()).isEqualTo(2);
}
}

0 comments on commit 6427be7

Please sign in to comment.