This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new c6c61935d69 Refactor ConstructorAdviceExecutorTest (#37679)
c6c61935d69 is described below
commit c6c61935d69bc512564daa15cc18678c6c63683c
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Jan 7 21:54:00 2026 +0800
Refactor ConstructorAdviceExecutorTest (#37679)
---
.../type/ConstructorAdviceExecutorTest.java | 26 ++++++----------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git
a/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/executor/type/ConstructorAdviceExecutorTest.java
b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/executor/type/ConstructorAdviceExecutorTest.java
index 95d1f765f04..5a51d32fa8f 100644
---
a/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/executor/type/ConstructorAdviceExecutorTest.java
+++
b/agent/core/src/test/java/org/apache/shardingsphere/agent/core/advisor/executor/type/ConstructorAdviceExecutorTest.java
@@ -17,6 +17,9 @@
package org.apache.shardingsphere.agent.core.advisor.executor.type;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.Setter;
import net.bytebuddy.dynamic.DynamicType.Builder;
import
net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.ImplementationDefinition;
import
net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition;
@@ -68,17 +71,13 @@ class ConstructorAdviceExecutorTest {
assertThat(executor.intercept(builder, mock()), is(intercepted));
}
+ @RequiredArgsConstructor
private static final class RecordingConstructorAdvice implements
ConstructorAdvice, AgentPluginEnable {
private final List<String> queue;
private final boolean pluginEnabled;
- RecordingConstructorAdvice(final List<String> queue, final boolean
pluginEnabled) {
- this.queue = queue;
- this.pluginEnabled = pluginEnabled;
- }
-
@Override
public boolean isPluginEnabled() {
return pluginEnabled;
@@ -90,14 +89,11 @@ class ConstructorAdviceExecutorTest {
}
}
+ @RequiredArgsConstructor
private static final class PluginDisabledConstructorAdvice implements
ConstructorAdvice, AgentPluginEnable {
private final List<String> queue;
- PluginDisabledConstructorAdvice(final List<String> queue) {
- this.queue = queue;
- }
-
@Override
public boolean isPluginEnabled() {
return false;
@@ -117,18 +113,10 @@ class ConstructorAdviceExecutorTest {
}
}
+ @Getter
+ @Setter
private static final class SimpleTargetAdviceObject implements
TargetAdviceObject {
private Object attachment;
-
- @Override
- public Object getAttachment() {
- return attachment;
- }
-
- @Override
- public void setAttachment(final Object attachment) {
- this.attachment = attachment;
- }
}
}