1
1
/*
2
- * Copyright 2012-2023 The Feign Authors
2
+ * Copyright 2012-2024 The Feign Authors
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5
5
* in compliance with the License. You may obtain a copy of the License at
@@ -659,14 +659,14 @@ void parameterizedHeaderExpandApi() throws Exception {
659
659
660
660
assertThat (md ).hasSize (1 );
661
661
662
- assertThat (md .get ( 0 ).configKey ())
662
+ assertThat (md .getFirst ( ).configKey ())
663
663
.isEqualTo ("ParameterizedHeaderExpandApi#getZone(String,String)" );
664
- assertThat (md .get ( 0 ).returnType ()).isEqualTo (String .class );
665
- assertThat (md .get ( 0 ).template ()).hasHeaders (entry ("Authorization" , asList ("{authHdr}" )),
664
+ assertThat (md .getFirst ( ).returnType ()).isEqualTo (String .class );
665
+ assertThat (md .getFirst ( ).template ()).hasHeaders (entry ("Authorization" , asList ("{authHdr}" )),
666
666
entry ("Accept" , asList ("application/json" )));
667
667
// Ensure that the authHdr expansion was properly detected and did not create a
668
668
// formParam
669
- assertThat (md .get ( 0 ).formParams ()).isEmpty ();
669
+ assertThat (md .getFirst ( ).formParams ()).isEmpty ();
670
670
}
671
671
672
672
@ Test
@@ -676,14 +676,15 @@ void parameterizedHeaderNotStartingWithCurlyBraceExpandApi() throws Exception {
676
676
677
677
assertThat (md ).hasSize (1 );
678
678
679
- assertThat (md .get ( 0 ).configKey ())
679
+ assertThat (md .getFirst ( ).configKey ())
680
680
.isEqualTo ("ParameterizedHeaderNotStartingWithCurlyBraceExpandApi#getZone(String,String)" );
681
- assertThat (md .get (0 ).returnType ()).isEqualTo (String .class );
682
- assertThat (md .get (0 ).template ()).hasHeaders (entry ("Authorization" , asList ("Bearer {authHdr}" )),
681
+ assertThat (md .getFirst ().returnType ()).isEqualTo (String .class );
682
+ assertThat (md .getFirst ().template ()).hasHeaders (
683
+ entry ("Authorization" , asList ("Bearer {authHdr}" )),
683
684
entry ("Accept" , asList ("application/json" )));
684
685
// Ensure that the authHdr expansion was properly detected and did not create a
685
686
// formParam
686
- assertThat (md .get ( 0 ).formParams ()).isEmpty ();
687
+ assertThat (md .getFirst ( ).formParams ()).isEmpty ();
687
688
}
688
689
689
690
@ Headers ("Authorization: Bearer {authHdr}" )
@@ -771,7 +772,7 @@ void staticMethodsOnInterfaceIgnored() throws Exception {
771
772
final List <MethodMetadata > mds =
772
773
contract .parseAndValidateMetadata (StaticMethodOnInterface .class );
773
774
assertThat (mds ).hasSize (1 );
774
- final MethodMetadata md = mds .get ( 0 );
775
+ final MethodMetadata md = mds .getFirst ( );
775
776
assertThat (md .configKey ()).isEqualTo ("StaticMethodOnInterface#get(String)" );
776
777
}
777
778
@@ -789,7 +790,7 @@ void defaultMethodsOnInterfaceIgnored() throws Exception {
789
790
final List <MethodMetadata > mds =
790
791
contract .parseAndValidateMetadata (DefaultMethodOnInterface .class );
791
792
assertThat (mds ).hasSize (1 );
792
- final MethodMetadata md = mds .get ( 0 );
793
+ final MethodMetadata md = mds .getFirst ( );
793
794
assertThat (md .configKey ()).isEqualTo ("DefaultMethodOnInterface#get(String)" );
794
795
}
795
796
@@ -802,8 +803,9 @@ interface SubstringQuery {
802
803
void paramIsASubstringOfAQuery () throws Exception {
803
804
final List <MethodMetadata > mds = contract .parseAndValidateMetadata (SubstringQuery .class );
804
805
805
- assertThat (mds .get (0 ).template ().queries ()).containsExactly (entry ("q" , asList ("body:{body}" )));
806
- assertThat (mds .get (0 ).formParams ()).isEmpty (); // Prevent issue 424
806
+ assertThat (mds .getFirst ().template ().queries ())
807
+ .containsExactly (entry ("q" , asList ("body:{body}" )));
808
+ assertThat (mds .getFirst ().formParams ()).isEmpty (); // Prevent issue 424
807
809
}
808
810
809
811
@ Test
0 commit comments