Skip to content

Commit

Permalink
Merge branch '2.6.x' into 2.7.x
Browse files Browse the repository at this point in the history
Closes gh-32145
  • Loading branch information
snicoll committed Aug 23, 2022
2 parents 392aec4 + 463766f commit 7a91fa9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,9 +30,11 @@
public class NettyProperties {

/**
* Level of leak detection for reference-counted buffers.
* Level of leak detection for reference-counted buffers. If not configured via
* 'ResourceLeakDetector.setLevel' or the 'io.netty.leakDetection.level' system
* property, default to 'simple'.
*/
private LeakDetection leakDetection = LeakDetection.SIMPLE;
private LeakDetection leakDetection;

public LeakDetection getLeakDetection() {
return this.leakDetection;
Expand Down
Expand Up @@ -1862,10 +1862,6 @@
"name": "spring.neo4j.uri",
"defaultValue": "bolt://localhost:7687"
},
{
"name": "spring.netty.leak-detection",
"defaultValue": "simple"
},
{
"name": "spring.quartz.jdbc.comment-prefix",
"defaultValue": [
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,11 +32,10 @@
class NettyPropertiesTests {

@Test
void defaultValueShouldMatchNettys() {
NettyProperties properties = new NettyProperties();
void defaultValueShouldBeConsistent() {
ResourceLeakDetector.Level defaultLevel = (Level) ReflectionTestUtils.getField(ResourceLeakDetector.class,
"DEFAULT_LEVEL");
assertThat(ResourceLeakDetector.Level.valueOf(properties.getLeakDetection().name())).isEqualTo(defaultLevel);
assertThat(defaultLevel).isEqualTo(Level.SIMPLE);
}

}

0 comments on commit 7a91fa9

Please sign in to comment.