2020import java .util .HashSet ;
2121import java .util .Set ;
2222import org .apache .rocketmq .proxy .common .ProxyContext ;
23+ import org .apache .rocketmq .proxy .config .ConfigurationManager ;
2324import org .apache .rocketmq .proxy .grpc .v2 .common .GrpcProxyException ;
2425import org .apache .rocketmq .proxy .service .ServiceManager ;
2526import org .apache .rocketmq .remoting .protocol .heartbeat .MessageModel ;
2627import org .apache .rocketmq .remoting .protocol .heartbeat .SubscriptionData ;
2728import org .apache .rocketmq .remoting .protocol .subscription .SubscriptionGroupConfig ;
2829import org .junit .jupiter .api .BeforeEach ;
2930import org .junit .jupiter .api .Test ;
31+ import org .junit .jupiter .api .extension .ExtendWith ;
3032import org .mockito .Mock ;
31- import org .mockito .MockitoAnnotations ;
33+ import org .mockito .junit . jupiter . MockitoExtension ;
3234
3335import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
3436import static org .junit .jupiter .api .Assertions .assertEquals ;
3537import static org .junit .jupiter .api .Assertions .assertThrows ;
3638import static org .junit .jupiter .api .Assertions .assertTrue ;
3739import static org .mockito .Mockito .when ;
3840
41+ @ ExtendWith (MockitoExtension .class )
3942class ClientProcessorTest {
4043
4144 @ Mock
@@ -53,8 +56,8 @@ class ClientProcessorTest {
5356 private ClientProcessor clientProcessor ;
5457
5558 @ BeforeEach
56- void setUp () {
57- MockitoAnnotations . openMocks ( this );
59+ void setUp () throws Exception {
60+ ConfigurationManager . intConfig ( );
5861 clientProcessor = new ClientProcessor (messagingProcessor , serviceManager );
5962 }
6063
@@ -180,7 +183,7 @@ void testValidateLiteSubscriptionQuota_withinQuota_noException() {
180183 void testValidateLiteSubscriptionQuota_exceedsQuota_throwsException () {
181184 String group = "group" ;
182185 int quota = 10 ;
183- int actual = 15 ;
186+ int actual = 15 + 300 /*quota buffer*/ ;
184187
185188 when (groupConfig .getLiteSubClientQuota ()).thenReturn (quota );
186189 when (messagingProcessor .getSubscriptionGroupConfig (ctx , group )).thenReturn (groupConfig );
0 commit comments