@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2012 - 2020 the original author or authors .
* Copyright 2012 - 2022 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -61,7 +61,7 @@ class DefaultWebClientExchangeTagsProviderTests {
@@ -61,7 +61,7 @@ class DefaultWebClientExchangeTagsProviderTests {
void tagsShouldBePopulated ( ) {
Iterable < Tag > tags = this . tagsProvider . tags ( this . request , this . response , null ) ;
assertThat ( tags ) . containsExactlyInAnyOrder ( Tag . of ( "method" , "GET" ) , Tag . of ( "uri" , "/projects/{project}" ) ,
Tag . of ( "clientN ame" , "example.org" ) , Tag . of ( "status" , "200" ) , Tag . of ( "outcome" , "SUCCESS" ) ) ;
Tag . of ( "client.n ame" , "example.org" ) , Tag . of ( "status" , "200" ) , Tag . of ( "outcome" , "SUCCESS" ) ) ;
}
@Test
@ -70,28 +70,28 @@ class DefaultWebClientExchangeTagsProviderTests {
@@ -70,28 +70,28 @@ class DefaultWebClientExchangeTagsProviderTests {
. create ( HttpMethod . GET , URI . create ( "https://example.org/projects/spring-boot" ) ) . build ( ) ;
Iterable < Tag > tags = this . tagsProvider . tags ( request , this . response , null ) ;
assertThat ( tags ) . containsExactlyInAnyOrder ( Tag . of ( "method" , "GET" ) , Tag . of ( "uri" , "/projects/spring-boot" ) ,
Tag . of ( "clientN ame" , "example.org" ) , Tag . of ( "status" , "200" ) , Tag . of ( "outcome" , "SUCCESS" ) ) ;
Tag . of ( "client.n ame" , "example.org" ) , Tag . of ( "status" , "200" ) , Tag . of ( "outcome" , "SUCCESS" ) ) ;
}
@Test
void tagsWhenIoExceptionShouldReturnIoErrorStatus ( ) {
Iterable < Tag > tags = this . tagsProvider . tags ( this . request , null , new IOException ( ) ) ;
assertThat ( tags ) . containsExactlyInAnyOrder ( Tag . of ( "method" , "GET" ) , Tag . of ( "uri" , "/projects/{project}" ) ,
Tag . of ( "clientN ame" , "example.org" ) , Tag . of ( "status" , "IO_ERROR" ) , Tag . of ( "outcome" , "UNKNOWN" ) ) ;
Tag . of ( "client.n ame" , "example.org" ) , Tag . of ( "status" , "IO_ERROR" ) , Tag . of ( "outcome" , "UNKNOWN" ) ) ;
}
@Test
void tagsWhenExceptionShouldReturnClientErrorStatus ( ) {
Iterable < Tag > tags = this . tagsProvider . tags ( this . request , null , new IllegalArgumentException ( ) ) ;
assertThat ( tags ) . containsExactlyInAnyOrder ( Tag . of ( "method" , "GET" ) , Tag . of ( "uri" , "/projects/{project}" ) ,
Tag . of ( "clientN ame" , "example.org" ) , Tag . of ( "status" , "CLIENT_ERROR" ) , Tag . of ( "outcome" , "UNKNOWN" ) ) ;
Tag . of ( "client.n ame" , "example.org" ) , Tag . of ( "status" , "CLIENT_ERROR" ) , Tag . of ( "outcome" , "UNKNOWN" ) ) ;
}
@Test
void tagsWhenCancelledRequestShouldReturnClientErrorStatus ( ) {
Iterable < Tag > tags = this . tagsProvider . tags ( this . request , null , null ) ;
assertThat ( tags ) . containsExactlyInAnyOrder ( Tag . of ( "method" , "GET" ) , Tag . of ( "uri" , "/projects/{project}" ) ,
Tag . of ( "clientN ame" , "example.org" ) , Tag . of ( "status" , "CLIENT_ERROR" ) , Tag . of ( "outcome" , "UNKNOWN" ) ) ;
Tag . of ( "client.n ame" , "example.org" ) , Tag . of ( "status" , "CLIENT_ERROR" ) , Tag . of ( "outcome" , "UNKNOWN" ) ) ;
}
}