Skip to content

Commit

Permalink
fix ut coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Peng Huo <[email protected]>
  • Loading branch information
penghuo committed Oct 28, 2023
1 parent c20762a commit cd01cf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import lombok.RequiredArgsConstructor;
import org.opensearch.sql.common.setting.Settings;
import org.opensearch.sql.spark.dispatcher.model.JobType;
import org.opensearch.sql.spark.execution.statestore.StateStore;
Expand Down Expand Up @@ -49,7 +48,6 @@ interface Rule<T> extends Predicate<T> {
String description();
}

@RequiredArgsConstructor
public class ConcurrentSessionRule implements Rule<LeaseRequest> {
@Override
public String description() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@

package org.opensearch.sql.spark.leasemanager;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opensearch.sql.common.setting.Settings;
import org.opensearch.sql.spark.dispatcher.model.JobType;
import org.opensearch.sql.spark.execution.statestore.StateStore;
import org.opensearch.sql.spark.leasemanager.model.LeaseRequest;

@ExtendWith(MockitoExtension.class)
class DefaultLeaseManagerTest {
@Mock private Settings settings;

@Mock private StateStore stateStore;

@Test
public void concurrentSessionRuleOnlyApplyToInteractiveQuery() {}
public void concurrentSessionRuleOnlyApplyToInteractiveQuery() {
new DefaultLeaseManager(settings, stateStore).borrow(new LeaseRequest(JobType.BATCH, "mys3"));
}
}

0 comments on commit cd01cf8

Please sign in to comment.