Skip to content

Commit 4f69c51

Browse files
committed
Can not mock final capacity
1 parent 50e3f0a commit 4f69c51

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/test/java/com/upserve/uppend/blobs/NativeIOTest.java

-18
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@
22

33
import com.upserve.uppend.util.SafeDeleting;
44
import org.junit.*;
5-
import org.junit.runner.RunWith;
6-
import org.mockito.Mock;
7-
import org.mockito.junit.MockitoJUnitRunner;
85

96
import java.io.IOException;
107
import java.nio.MappedByteBuffer;
118
import java.nio.channels.FileChannel;
129
import java.nio.file.*;
1310

14-
import static org.mockito.Mockito.when;
15-
16-
@RunWith(MockitoJUnitRunner.class)
1711
public class NativeIOTest {
1812

1913
String fname = "test_file";
@@ -34,21 +28,9 @@ public void tearDown() throws IOException {
3428
SafeDeleting.removeDirectory(rootPath);
3529
}
3630

37-
@Mock
38-
MappedByteBuffer mockBuffer;
39-
4031
@Test
4132
public void test_madvise() throws IOException {
4233
MappedByteBuffer buffer = fc.map(FileChannel.MapMode.READ_WRITE, 57, 5329);
4334
NativeIO.madvise(buffer, NativeIO.Advice.Sequential);
4435
}
45-
46-
@Test
47-
public void test_madvise_raise() throws IOException {
48-
when(mockBuffer.isDirect()).thenReturn(true);
49-
//when(mockBuffer.capacity()).thenReturn(-100);
50-
NativeIO.madvise(mockBuffer, NativeIO.Advice.Random);
51-
}
52-
53-
5436
}

0 commit comments

Comments
 (0)