@@ -42,7 +42,7 @@ public void testGetUsageNonExistentPolicy() {
4242 // Test where policy does not exist
4343 ClusterState state = ClusterState .builder (new ClusterName ("mycluster" )).build ();
4444 assertThat (
45- new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).calculateUsage ("mypolicy" ),
45+ new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).retrieveCalculatedUsage ("mypolicy" ),
4646 equalTo (new ItemUsage (List .of (), List .of (), List .of ()))
4747 );
4848 }
@@ -63,7 +63,7 @@ public void testGetUsageUnusedPolicy() {
6363 )
6464 .build ();
6565 assertThat (
66- new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).calculateUsage ("mypolicy" ),
66+ new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).retrieveCalculatedUsage ("mypolicy" ),
6767 equalTo (new ItemUsage (List .of (), List .of (), List .of ()))
6868 );
6969 }
@@ -89,7 +89,7 @@ public void testGetUsagePolicyUsedByIndex() {
8989 )
9090 .build ();
9191 assertThat (
92- new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).calculateUsage ("mypolicy" ),
92+ new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).retrieveCalculatedUsage ("mypolicy" ),
9393 equalTo (new ItemUsage (List .of ("myindex" ), List .of (), List .of ()))
9494 );
9595 }
@@ -134,7 +134,7 @@ public void testGetUsagePolicyUsedByIndexAndTemplate() {
134134 )
135135 .build ();
136136 assertThat (
137- new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).calculateUsage ("mypolicy" ),
137+ new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).retrieveCalculatedUsage ("mypolicy" ),
138138 equalTo (new ItemUsage (List .of ("myindex" ), List .of (), List .of ("mytemplate" )))
139139 );
140140 }
@@ -182,7 +182,7 @@ public void testGetUsagePolicyUsedByIndexAndTemplateAndDataStream() {
182182
183183 ClusterState state = ClusterState .builder (new ClusterName ("mycluster" )).metadata (mBuilder .build ()).build ();
184184 assertThat (
185- new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).calculateUsage ("mypolicy" ),
185+ new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).retrieveCalculatedUsage ("mypolicy" ),
186186 equalTo (new ItemUsage (List .of ("myindex" , "another" ), List .of ("myds" ), List .of ("mytemplate" )))
187187 );
188188 }
@@ -228,7 +228,7 @@ public void testGetUsagePolicyNotUsedByDataStreamDueToOverride() {
228228 // Test where policy exists and is used by an index, datastream, and template
229229 ClusterState state = ClusterState .builder (new ClusterName ("mycluster" )).metadata (mBuilder .build ()).build ();
230230 assertThat (
231- new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).calculateUsage ("mypolicy" ),
231+ new LifecyclePolicyUsageCalculator (iner , state , List .of ("mypolicy" )).retrieveCalculatedUsage ("mypolicy" ),
232232 equalTo (new ItemUsage (List .of ("myindex" ), List .of (), List .of ("mytemplate" )))
233233 );
234234 }
0 commit comments