github-advanced-security[bot] commented on code in PR #17988: URL: https://github.com/apache/druid/pull/17988#discussion_r2081066043
########## indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/LagBasedAutoScalerTest.java: ########## @@ -0,0 +1,357 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.indexing.seekablestream.supervisor.autoscaler; + +import com.google.common.collect.ImmutableList; +import org.apache.druid.indexing.overlord.supervisor.SupervisorSpec; +import org.apache.druid.indexing.overlord.supervisor.autoscaler.AggregateFunction; +import org.apache.druid.indexing.overlord.supervisor.autoscaler.LagStats; +import org.apache.druid.indexing.seekablestream.supervisor.SeekableStreamSupervisor; +import org.apache.druid.indexing.seekablestream.supervisor.SeekableStreamSupervisorIOConfig; +import org.apache.druid.java.util.emitter.service.ServiceEmitter; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.mockito.ArgumentMatchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; + +import java.util.List; +import java.util.concurrent.Callable; + +public class LagBasedAutoScalerTest +{ + private static final String DATASOURCE = "testDataSource"; + private static final String STREAM = "testStream"; + + private static final int DEFAULT_MIN_TASK_COUNT = 0; + private static final int DEFAULT_SCALE_IN = 1; + private static final int DEFAULT_SCALE_OUT = 1; + private static final long DEFAULT_SCALE_IN_THRESHOLD = 100L; + private static final long DEFAULT_SCALE_OUT_THRESHOLD = 1000L; + private static final double DEFAULT_SCALE_IN_THRESHOLD_PCT = 0.9; + private static final double DEFAULT_SCALE_OUT_THRESHOLD_PCT = 0.2; + + @Mock + private SeekableStreamSupervisor supervisor; + + @Mock + private SupervisorSpec spec; + + @Mock + private ServiceEmitter emitter; + + @Mock + private SeekableStreamSupervisorIOConfig ioConfig; + + private LagBasedAutoScalerConfig defaultConfig; + + @Before + public void setup() + { + MockitoAnnotations.initMocks(this); Review Comment: ## Deprecated method or constructor invocation Invoking [MockitoAnnotations.initMocks](1) should be avoided because it has been deprecated. [Show more details](https://github.com/apache/druid/security/code-scanning/9167) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
