mirror of
https://github.com/corda/corda.git
synced 2025-06-19 15:43:52 +00:00
CORDA-716 Retire MockNetwork.Factory (#1937)
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
package net.corda.testing.node;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MockNodeFactoryInJavaTest {
|
||||
private static class CustomNode extends MockNetwork.MockNode {
|
||||
private CustomNode(@NotNull MockNodeArgs args) {
|
||||
super(args);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Does not need to run, only compile.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private static void factoryIsEasyToPassInUsingJava() {
|
||||
//noinspection Convert2MethodRef
|
||||
new MockNetwork(new MockNetworkParameters().setDefaultFactory(args -> new CustomNode(args)));
|
||||
new MockNetwork(new MockNetworkParameters().setDefaultFactory(CustomNode::new));
|
||||
//noinspection Convert2MethodRef
|
||||
new MockNetwork().createNode(new MockNodeParameters(), args -> new CustomNode(args));
|
||||
new MockNetwork().createNode(new MockNodeParameters(), CustomNode::new);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user