11/*
2- * Copyright 2020-2022 the original author or authors.
2+ * Copyright 2020-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ void testMicrometerHolderRecordSuccessWorksGracefullyAfterDestroy() {
5757 given (beanProvider .getIfUnique ()).willReturn (meterRegistry );
5858
5959 MicrometerHolder micrometerHolder = new MicrometerHolder (ctx , "holderName" ,
60- "timerName" , "timerDesc" , Collections .emptyMap ());
60+ "timerName" , "timerDesc" , r -> Collections .emptyMap ());
6161 Map <String , Timer > meters = (Map <String , Timer >) ReflectionTestUtils .getField (micrometerHolder , "meters" );
6262 assertThat (meters ).hasSize (1 );
6363
@@ -77,23 +77,23 @@ void testMicrometerHolderRecordSuccessWorksGracefullyAfterDestroy() {
7777 @ Test
7878 void multiReg () {
7979 assertThatIllegalStateException ().isThrownBy (() -> new MicrometerHolder (
80- new AnnotationConfigApplicationContext (Config1 .class ), "" , "" , "" , Collections .emptyMap ()))
80+ new AnnotationConfigApplicationContext (Config1 .class ), "" , "" , "" , r -> Collections .emptyMap ()))
8181 .withMessage ("No micrometer registry present (or more than one and "
8282 + "there is not exactly one marked with @Primary)" );
8383 }
8484
8585 @ Test
8686 void twoPrimaries () {
8787 assertThatIllegalStateException ().isThrownBy (() -> new MicrometerHolder (
88- new AnnotationConfigApplicationContext (Config2 .class ), "" , "" , "" , Collections .emptyMap ()))
88+ new AnnotationConfigApplicationContext (Config2 .class ), "" , "" , "" , r -> Collections .emptyMap ()))
8989 .withMessageContaining ("more than one 'primary' bean" );
9090 }
9191
9292 @ Test
9393 void primary () {
9494 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (Config3 .class );
9595 MicrometerHolder micrometerHolder = new MicrometerHolder (ctx , "holderName" ,
96- "timerName" , "timerDesc" , Collections .emptyMap ());
96+ "timerName" , "timerDesc" , r -> Collections .emptyMap ());
9797 @ SuppressWarnings ("unchecked" )
9898 Map <String , Timer > meters = (Map <String , Timer >) ReflectionTestUtils .getField (micrometerHolder , "meters" );
9999 assertThat (meters ).hasSize (1 );
0 commit comments