Skip to content

Commit 4d2852e

Browse files
committed
* test: update junit to 6.0.0
Signed-off-by: neo <1100909+neowu@users.noreply.github.com>
1 parent 75575c7 commit 4d2852e

File tree

9 files changed

+20
-11
lines changed

9 files changed

+20
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
> updated WebContext
1212
> updated LogManager
1313
* sse: fixed memory leak under heavy load
14-
> exchange was not properly closed under heavy IO + throwing error on connect
14+
> exchange was not properly closed under heavy IO + throwing error on connect + azure lb didn't time out connection
15+
* test: update junit to 6.0.0
1516

1617
### 9.2.4 (8/8/2025 - 8/21/2025)
1718

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
subprojects {
88
group = "core.framework"
9-
version = "9.3.0-b2"
9+
version = "9.3.0"
1010
repositories {
1111
maven {
1212
url = uri("https://neowu.github.io/maven-repo/")
@@ -19,7 +19,7 @@ subprojects {
1919

2020
val elasticVersion = "8.18.1"
2121
val jacksonVersion = "2.20.0"
22-
val junitVersion = "5.13.4"
22+
val junitVersion = "6.0.0"
2323
val mockitoVersion = "5.20.0"
2424
val assertjVersion = "3.27.6"
2525

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package core.framework.module;
22

3+
import org.jspecify.annotations.Nullable;
4+
35
/**
46
* @author neo
57
*/
68
public class TestCacheConfig extends CacheConfig {
79
@Override
8-
void configureRedis(String host, String password) {
10+
void configureRedis(String host, @Nullable String password) {
911
local();
1012
}
1113
}

core-ng-test/src/main/java/core/framework/test/IntegrationExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public final class IntegrationExtension implements TestInstancePostProcessor {
1414
public void postProcessTestInstance(Object testInstance, ExtensionContext context) {
1515
ExtensionContext.Store store = context.getRoot().getStore(ExtensionContext.Namespace.GLOBAL);
1616
Class<?> testClass = context.getRequiredTestClass();
17-
AbstractTestModule module = store.getOrComputeIfAbsent(AbstractTestModule.class, key -> createTestModule(testClass, store), AbstractTestModule.class);
17+
AbstractTestModule module = store.computeIfAbsent(AbstractTestModule.class, key -> createTestModule(testClass, store), AbstractTestModule.class);
1818
module.inject(testInstance);
1919
}
2020

core-ng-test/src/main/java/core/framework/test/module/TestModuleContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected <T> Class<T> configClass(Class<T> configClass) { // try to find ove
5555

5656
@SuppressWarnings("unchecked")
5757
@Override
58-
public <T> T bind(Type type, String name, T instance) {
58+
public <T> T bind(Type type, @Nullable String name, T instance) {
5959
var key = new Key(type, name);
6060
T overrideBinding = (T) overrideBindings.get(key);
6161
if (overrideBinding != null) {
@@ -72,7 +72,7 @@ public void validate() {
7272
validateOverrideBindings();
7373
}
7474

75-
<T> T overrideBinding(Type type, String name, T instance) {
75+
<T> T overrideBinding(Type type, @Nullable String name, T instance) {
7676
Object previous = overrideBindings.put(new Key(type, name), instance);
7777
if (previous != null) throw new Error(format("found duplicate override binding, type={}, name={}, previous={}", type.getTypeName(), name, previous));
7878
return instance;

core-ng-test/src/main/java/core/framework/test/redis/MockRedis.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import core.framework.redis.RedisSet;
99
import core.framework.redis.RedisSortedSet;
1010
import core.framework.util.Maps;
11+
import org.jspecify.annotations.Nullable;
1112

1213
import java.time.Duration;
1314
import java.util.Map;
@@ -28,14 +29,15 @@ public final class MockRedis implements Redis {
2829
private final MockRedisHyperLogLog hyperLogLog = new MockRedisHyperLogLog(store);
2930

3031
@Override
32+
@Nullable
3133
public String get(String key) {
3234
var value = store.get(key);
3335
if (value == null) return null;
3436
return value.string();
3537
}
3638

3739
@Override
38-
public boolean set(String key, String value, Duration expiration, boolean onlyIfAbsent) {
40+
public boolean set(String key, String value, @Nullable Duration expiration, boolean onlyIfAbsent) {
3941
MockRedisStore.Value redisValue = new MockRedisStore.Value(value);
4042
if (expiration != null) redisValue.expirationTime = System.currentTimeMillis() + expiration.toMillis();
4143
if (onlyIfAbsent) {

core-ng-test/src/main/java/core/framework/test/redis/MockRedisHash.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public Map<String, String> getAll(String key) {
3838
}
3939

4040
@Override
41+
@Nullable
4142
public String get(String key, String field) {
4243
var value = store.get(key);
4344
if (value == null) return null;

core-ng-test/src/test/java/core/framework/test/TestModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.List;
2323
import java.util.Optional;
2424

25+
import static org.assertj.core.api.Assertions.assertThat;
2526
import static org.mockito.Mockito.mock;
2627

2728
/**
@@ -122,6 +123,7 @@ private void configureDB() {
122123
db().view(TestDBView.class);
123124
db().view(TestDBProjection.class);
124125
initDB().createSchema();
126+
assertThat(initDB().repository(TestDBEntity.class)).isNotNull();
125127
}
126128

127129
private void configureJob() {

core-ng/src/main/java/core/framework/internal/redis/RedisImpl.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,13 @@ public void close() {
8585
}
8686

8787
@Override
88+
@Nullable
8889
public String get(String key) {
8990
validate("key", key); // only validate on interface methods, internal usage will be checked by caller
9091
return decode(getBytes(key));
9192
}
9293

93-
public byte[] getBytes(String key) {
94+
public byte @Nullable [] getBytes(String key) {
9495
var watch = new StopWatch();
9596
byte[] value = null;
9697
PoolItem<RedisConnection> item = pool.borrowItem();
@@ -116,13 +117,13 @@ public RedisSet set() {
116117
}
117118

118119
@Override
119-
public boolean set(String key, String value, Duration expiration, boolean onlyIfAbsent) {
120+
public boolean set(String key, String value, @Nullable Duration expiration, boolean onlyIfAbsent) {
120121
validate("key", key);
121122
validate("value", value);
122123
return set(key, encode(value), expiration, onlyIfAbsent);
123124
}
124125

125-
public boolean set(String key, byte[] value, Duration expiration, boolean onlyIfAbsent) {
126+
public boolean set(String key, byte[] value, @Nullable Duration expiration, boolean onlyIfAbsent) {
126127
var watch = new StopWatch();
127128
byte[] expirationValue = expiration == null ? null : expirationValue(expiration);
128129
boolean updated = false;

0 commit comments

Comments
 (0)