Change format of user agent to be aligned with the original PR from @msailes
This commit is contained in:
@@ -64,9 +64,9 @@ public final class CustomRuntimeEventLoop implements SmartLifecycle {
|
||||
private static final String LAMBDA_RUNTIME_URL_TEMPLATE = "http://{0}/{1}/runtime/invocation/next";
|
||||
private static final String LAMBDA_INVOCATION_URL_TEMPLATE = "http://{0}/{1}/runtime/invocation/{2}/response";
|
||||
private static final String USER_AGENT_VALUE = String.format(
|
||||
"spring-cloud-function:%s/JAVA-%s",
|
||||
extractVersion(),
|
||||
System.getProperty("java.vm.name"));
|
||||
"spring-cloud-function/%s-%s",
|
||||
System.getProperty("java.runtime.version"),
|
||||
extractVersion());
|
||||
|
||||
private final ConfigurableApplicationContext applicationContext;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CustomRuntimeEventLoopTest {
|
||||
AWSCustomRuntime aws = userContext.getBean(AWSCustomRuntime.class);
|
||||
Message<String> replyMessage = aws.exchange("\"ricky\"");
|
||||
assertThat(replyMessage.getHeaders()).containsKey("user-agent");
|
||||
assertThat(((String) replyMessage.getHeaders().get("user-agent"))).startsWith("spring-cloud-function:");
|
||||
assertThat(((String) replyMessage.getHeaders().get("user-agent"))).startsWith("spring-cloud-function");
|
||||
assertThat(aws.exchange("\"ricky\"").getPayload()).isEqualTo("\"RICKY\"");
|
||||
assertThat(aws.exchange("\"julien\"").getPayload()).isEqualTo("\"JULIEN\"");
|
||||
assertThat(aws.exchange("\"bubbles\"").getPayload()).isEqualTo("\"BUBBLES\"");
|
||||
|
||||
Reference in New Issue
Block a user