GithubHelp home page GithubHelp logo

jetaggart / testcontainers-java-module-ganache Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ganchix/testcontainers-java-module-ganache

0.0 0.0 0.0 69 KB

Testcontainers module for Ganache CLI

License: MIT License

Shell 5.92% Java 94.08%

testcontainers-java-module-ganache's Introduction

TestContainers Ganache testing module Build Status codecov Maven Central GitHub stars

Testcontainers module for Ganache.

Table of Contents

Overview

A simple way to test Ethereum in your Java Code

See testcontainers.org for more information about Testcontainers.

Getting started

Add dependency

Maven
<dependency>
    <groupId>io.github.ganchix</groupId>
    <artifactId>testcontainers-java-module-ganache</artifactId>
    <version>0.0.4</version>
</dependency>
Gradle
compile group: 'io.github.ganchix', name: 'testcontainers-java-module-ganache', version: '0.0.1'

Code example

Running Ganache during a test:

public class SomeTest {


	@Rule
	public GanacheContainer GanacheContainer = new GanacheContainer();

    
	@Test
	public void simpleTestWithClientCreation() {
            Web3j web3j = ganacheContainer.getWeb3j();
            assertEquals( web3j.ethBlockNumber().send().getBlockNumber(), BigInteger.ZERO);
            assertNotNull(ganacheContainer);
	}
}

Considerations

To obtain the data of addresses and privates keys of console log we implemented a custom log consumer LogGanacheExtractorConsumer, if you overwrite it this information will not be extracted.

License

Testcontainers module for Ganache is licensed under the MIT License. See LICENSE for details.

Copyright (c) 2018 Rafael Ríos Moya

testcontainers-java-module-ganache's People

Contributors

ganchix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.