Skip to content

Commit ae79025

Browse files
committed
dbeaver/pro#7636 fixes after review
1 parent abf3d20 commit ae79025

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebTestUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public static void setPrivateField(
6363
if (f == null) {
6464
throw new NoSuchFieldException(fieldName);
6565
}
66+
boolean isAccessible = f.canAccess(target);
6667
f.setAccessible(true);
6768
f.set(target, value);
69+
f.setAccessible(isAccessible);
6870
}
6971
}

server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/navigator/WebNavigatorNodeInfoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DBeaver - Universal Database Manager
3-
* Copyright (C) 2010-2024 DBeaver Corp and others
3+
* Copyright (C) 2010-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/session/WebSessionProjectTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DBeaver - Universal Database Manager
3-
* Copyright (C) 2010-2024 DBeaver Corp and others
3+
* Copyright (C) 2010-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.

server/test/io.cloudbeaver.test.platform/src/io/cloudbeaver/model/session/WebSessionTest.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DBeaver - Universal Database Manager
3-
* Copyright (C) 2010-2024 DBeaver Corp and others
3+
* Copyright (C) 2010-2025 DBeaver Corp and others
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
import io.cloudbeaver.model.app.ServletAuthApplication;
2222
import org.jkiss.dbeaver.model.websocket.event.WSEventController;
2323
import org.junit.Assert;
24+
import org.junit.Before;
2425
import org.junit.Test;
2526
import org.mockito.Mockito;
2627

@@ -31,9 +32,15 @@
3132

3233
public class WebSessionTest extends CloudbeaverMockTest {
3334

35+
private WebSession session;
36+
37+
@Before
38+
public void initWebSession() throws Exception {
39+
session = new WebSession(getFakeRequestInfo(), mockApplication(), Collections.emptyMap());
40+
}
41+
3442
@Test
3543
public void localeAndBasicAttributes() throws Exception {
36-
WebSession session = new WebSession(getFakeRequestInfo(), mockApplication(), Collections.emptyMap());
3744
// Locale
3845
session.setLocale("test-locale");
3946
Assert.assertEquals("test-locale", session.getLocale());
@@ -65,7 +72,6 @@ public void localeAndBasicAttributes() throws Exception {
6572

6673
@Test
6774
public void asyncTaskStatusNotFound() throws Exception {
68-
WebSession session = new WebSession(getFakeRequestInfo(), mockApplication(), Collections.emptyMap());
6975
Assert.assertThrows(
7076
"DBWebException must be thrown for unknown async task",
7177
DBWebException.class, () -> session.asyncTaskStatus("nonexistent-task", false)

0 commit comments

Comments
 (0)