Search in sources :

Example 6 with AppInfo

use of com.nike.riposte.server.config.AppInfo in project riposte by Nike-Inc.

the class AwsUtilTest method getAppInfoFutureWithAwsInfo_with_all_args_returns_AppInfoImpl_createLocalInstance_if_environment_is_local_or_compiletimetest.

@DataProvider(value = { "local", "compiletimetest" })
@Test
public void getAppInfoFutureWithAwsInfo_with_all_args_returns_AppInfoImpl_createLocalInstance_if_environment_is_local_or_compiletimetest(String environment) {
    // given
    String appId = "appid-" + UUID.randomUUID().toString();
    AppInfo expectedResult = AppInfoImpl.createLocalInstance(appId);
    // when
    AppInfo result = AwsUtil.getAppInfoFutureWithAwsInfo(appId, environment, asyncClientMock).join();
    // then
    assertThat(result.appId()).isEqualTo(expectedResult.appId()).isEqualTo(appId);
    assertThat(result.environment()).isEqualTo(expectedResult.environment());
    assertThat(result.dataCenter()).isEqualTo(expectedResult.dataCenter());
    assertThat(result.instanceId()).isEqualTo(expectedResult.instanceId());
}
Also used : AppInfo(com.nike.riposte.server.config.AppInfo) DataProvider(com.tngtech.java.junit.dataprovider.DataProvider) Test(org.junit.Test)

Aggregations

AppInfo (com.nike.riposte.server.config.AppInfo)6 Test (org.junit.Test)4 AppInfoImpl (com.nike.riposte.server.config.impl.AppInfoImpl)2 UnknownHostException (java.net.UnknownHostException)2 TypeReference (com.fasterxml.jackson.core.type.TypeReference)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 AsyncHttpClientHelper (com.nike.riposte.client.asynchttp.ning.AsyncHttpClientHelper)1 Response (com.ning.http.client.Response)1 DataProvider (com.tngtech.java.junit.dataprovider.DataProvider)1 HttpMethod (io.netty.handler.codec.http.HttpMethod)1 InetAddress (java.net.InetAddress)1 Map (java.util.Map)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1