@ -27,12 +27,14 @@ import java.nio.file.Paths;
import java.util.Arrays ;
import java.util.Arrays ;
import java.util.EnumMap ;
import java.util.EnumMap ;
import java.util.HashMap ;
import java.util.HashMap ;
import java.util.Iterator ;
import java.util.Map ;
import java.util.Map ;
import java.util.Optional ;
import java.util.Optional ;
import java.util.concurrent.TimeUnit ;
import java.util.concurrent.TimeUnit ;
import java.util.regex.Matcher ;
import java.util.regex.Matcher ;
import java.util.regex.Pattern ;
import java.util.regex.Pattern ;
import com.google.common.base.Splitter ;
import io.vertx.core.Vertx ;
import io.vertx.core.Vertx ;
import io.vertx.core.http.HttpClientOptions ;
import io.vertx.core.http.HttpClientOptions ;
import io.vertx.core.http.RequestOptions ;
import io.vertx.core.http.RequestOptions ;
@ -42,12 +44,14 @@ import org.junit.After;
import org.junit.AfterClass ;
import org.junit.AfterClass ;
import org.junit.Before ;
import org.junit.Before ;
import org.junit.BeforeClass ;
import org.junit.BeforeClass ;
import org.junit.Ignore ;
import org.junit.FixMethodOrder ;
import org.junit.Test ;
import org.junit.Test ;
import org.junit.runners.MethodSorters ;
import org.web3j.protocol.Web3j ;
import org.web3j.protocol.Web3j ;
import org.web3j.protocol.http.HttpService ;
import org.web3j.protocol.http.HttpService ;
import org.web3j.utils.Async ;
import org.web3j.utils.Async ;
@FixMethodOrder ( MethodSorters . NAME_ASCENDING )
public class DockerQuickstartTest {
public class DockerQuickstartTest {
private static final String PROJECT_ROOT =
private static final String PROJECT_ROOT =
@ -106,7 +110,7 @@ public class DockerQuickstartTest {
assertThat ( services ) . isNotNull ( ) . isNotEmpty ( ) ;
assertThat ( services ) . isNotNull ( ) . isNotEmpty ( ) ;
assertThat ( endpoints ) . isNotNull ( ) . isNotEmpty ( ) ;
assertThat ( endpoints ) . isNotNull ( ) . isNotEmpty ( ) ;
HttpService httpService =
final HttpService httpService =
new HttpService (
new HttpService (
DEFAULT_HTTP_RPC_HOST
DEFAULT_HTTP_RPC_HOST
+ ":"
+ ":"
@ -170,10 +174,11 @@ public class DockerQuickstartTest {
}
}
@Test
@Test
public void servicesShouldBeUp ( ) {
// Method starts with an underscore so it lexicographically sorts first.
public void _servicesShouldBeUp ( ) {
Awaitility . await ( )
Awaitility . await ( )
. ignoreExceptions ( )
. ignoreExceptions ( )
. atMost ( 6 0, TimeUnit . SECONDS )
. atMost ( 9 0, TimeUnit . SECONDS )
. untilAsserted (
. untilAsserted (
( ) - >
( ) - >
Arrays . stream ( ServicesIdentifier . values ( ) )
Arrays . stream ( ServicesIdentifier . values ( ) )
@ -213,16 +218,17 @@ public class DockerQuickstartTest {
}
}
@Test
@Test
@Ignore
public void rpcNodeShouldReturnCorrectVersion ( ) {
public void rpcNodeShouldReturnCorrectVersion ( ) {
final String expectedVersion = PantheonInfo . version ( ) ;
final Iterator < String > versionParts = Splitter . on ( "/" ) . split ( PantheonInfo . version ( ) ) . iterator ( ) ;
final String versionPrefix = versionParts . next ( ) + "/" + versionParts . next ( ) + "/" ;
Awaitility . await ( )
Awaitility . await ( )
. ignoreExceptions ( )
. ignoreExceptions ( )
. atMost ( 60 , TimeUnit . SECONDS )
. atMost ( 60 , TimeUnit . SECONDS )
. untilAsserted (
. untilAsserted (
( ) - >
( ) - >
assertThat ( web3HttpClient . web3ClientVersion ( ) . send ( ) . getWeb3ClientVersion ( ) )
assertThat ( web3HttpClient . web3ClientVersion ( ) . send ( ) . getWeb3ClientVersion ( ) )
. isEqualTo ( expectedVersion ) ) ;
. startsWith ( versionPrefix ) ) ;
}
}
@Test
@Test
@ -258,7 +264,7 @@ public class DockerQuickstartTest {
Awaitility . await ( )
Awaitility . await ( )
. ignoreExceptions ( )
. ignoreExceptions ( )
. atMost ( 30 , TimeUnit . SECONDS )
. atMost ( 45 , TimeUnit . SECONDS )
. untilAsserted ( ( ) - > assertThat ( wsConnection [ 0 ] ) . isNotNull ( ) ) ;
. untilAsserted ( ( ) - > assertThat ( wsConnection [ 0 ] ) . isNotNull ( ) ) ;
} finally {
} finally {
assertThat ( wsConnection [ 0 ] ) . isNotNull ( ) ;
assertThat ( wsConnection [ 0 ] ) . isNotNull ( ) ;