Commit 423a3160 authored by Michel Schudel's avatar Michel Schudel

wrote some unit tests to check p2p behaviour

parent 154cf858
package nl.craftsmen.blockchain.craftscoinnode;
import nl.craftsmen.blockchain.craftscoinnode.util.InstanceInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.net.Inet4Address;
import java.net.UnknownHostException;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class BlockchainServiceApplicationTests {
@Autowired
InstanceInfo instanceInfo;
@Test
public void nodeInformationIsAvailable() throws UnknownHostException {
String host = Inet4Address
.getLocalHost()
.getHostAddress();
//spring server properties aren't injected when running a springboot integration test so we check for 0.
assertThat(instanceInfo.getNode()).isEqualTo(host + ":" + 0);
public void wiring() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment