Search in sources :

Example 6 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class OcspStaplingIT method setup.

@BeforeAll
static void setup() throws Exception {
    int jettyServerPortNo = startOcspMock();
    endUserKeyFile = Files.createTempFile("end_key", "pem");
    endUserCertFile = Files.createTempFile("end_key", "pem");
    intKeyFile = Files.createTempFile("int_key", "pem");
    Path intCertFile = Files.createTempFile("int_key", "pem");
    rootCertFile = Files.createTempFile("root_key", "pem");
    rootKeyFile = Files.createTempFile("root_key", "pem");
    // make sure files are not there
    Files.delete(endUserKeyFile);
    Files.delete(endUserCertFile);
    Files.delete(rootKeyFile);
    Files.delete(rootCertFile);
    Files.delete(intKeyFile);
    Files.delete(intCertFile);
    var bouncyCastleProvider = new BouncyCastleProvider();
    CertificateChainFactory.createCertificateChain(endUserCertFile, endUserKeyFile, intCertFile, intKeyFile, rootCertFile, rootKeyFile, jettyServerPortNo, bouncyCastleProvider);
    util = new TransportTestUtil();
}
Also used : Path(java.nio.file.Path) TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) BouncyCastleProvider(org.bouncycastle.jce.provider.BouncyCastleProvider) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 7 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class SupportedStructTypesV2IT method setup.

@BeforeEach
public void setup(TestInfo testInfo) throws IOException {
    server.setConfigure(withOptionalBoltEncryption());
    server.init(testInfo);
    address = server.lookupDefaultConnector();
    util = new TransportTestUtil(new Neo4jPackV2());
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) Neo4jPackV2(org.neo4j.bolt.packstream.Neo4jPackV2) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class BoltChannelAutoReadLimiterIT method setup.

@BeforeEach
public void setup(TestInfo testInfo) throws Exception {
    server.setGraphDatabaseFactory(getTestGraphDatabaseFactory());
    server.setConfigure(getSettingsFunction());
    server.init(testInfo);
    address = server.lookupDefaultConnector();
    connection = new SocketConnection();
    util = new TransportTestUtil();
    installSleepProcedure(server.graphDatabaseService());
}
Also used : SocketConnection(org.neo4j.bolt.testing.client.SocketConnection) TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 9 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class BoltV3TransportBase method setUp.

@BeforeEach
public void setUp(TestInfo testInfo) throws IOException {
    server.setConfigure(settings -> {
        withOptionalBoltEncryption().accept(settings);
        settings.put(FabricSettings.enabled_by_default, fabricEnabled());
    });
    server.init(testInfo);
    address = server.lookupDefaultConnector();
    util = new TransportTestUtil(newMessageEncoder());
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 10 with TransportTestUtil

use of org.neo4j.bolt.testing.TransportTestUtil in project neo4j by neo4j.

the class CertificatesIT method setup.

@BeforeAll
public static void setup() throws IOException, GeneralSecurityException, OperatorCreationException {
    certFactory = new SelfSignedCertificateFactory();
    keyFile = Files.createTempFile("key", "pem");
    certFile = Files.createTempFile("key", "pem");
    // make sure files are not there
    Files.delete(keyFile);
    Files.delete(certFile);
    certFactory.createSelfSignedCertificate(certFile, keyFile, "my.domain");
    util = new TransportTestUtil();
}
Also used : TransportTestUtil(org.neo4j.bolt.testing.TransportTestUtil) SelfSignedCertificateFactory(org.neo4j.test.ssl.SelfSignedCertificateFactory) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

TransportTestUtil (org.neo4j.bolt.testing.TransportTestUtil)16 BeforeEach (org.junit.jupiter.api.BeforeEach)12 BeforeAll (org.junit.jupiter.api.BeforeAll)3 Neo4jPackV2 (org.neo4j.bolt.packstream.Neo4jPackV2)2 SocketConnection (org.neo4j.bolt.testing.client.SocketConnection)2 SelfSignedCertificateFactory (org.neo4j.test.ssl.SelfSignedCertificateFactory)2 Path (java.nio.file.Path)1 BouncyCastleProvider (org.bouncycastle.jce.provider.BouncyCastleProvider)1 SocketAddress (org.neo4j.configuration.helpers.SocketAddress)1