Search in sources :

Example 1 with StyxHeaderConfig

use of com.hotels.styx.client.StyxHeaderConfig in project styx by ExpediaGroup.

the class ResponseInfoFormatTest method canConfigureCustomHeaderFormatWithVersion.

@Test
public void canConfigureCustomHeaderFormatWithVersion() {
    StyxHeaderConfig styxHeaderConfig = new StyxHeaderConfig(new StyxHeaderConfig.StyxHeader(null, "{VERSION};{REQUEST_ID};{INSTANCE}"), null, null);
    Environment environment = environment(new MapBackedConfiguration().set("styxHeaders", styxHeaderConfig));
    String info = new ResponseInfoFormat(environment).format(request);
    assertThat(info, is("STYX-dev.0.0;" + request.id() + ";noJvmRouteSet"));
}
Also used : StyxHeaderConfig(com.hotels.styx.client.StyxHeaderConfig) MapBackedConfiguration(com.hotels.styx.api.configuration.Configuration.MapBackedConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

MapBackedConfiguration (com.hotels.styx.api.configuration.Configuration.MapBackedConfiguration)1 StyxHeaderConfig (com.hotels.styx.client.StyxHeaderConfig)1 Test (org.junit.jupiter.api.Test)1