@@ -724,8 +724,8 @@ public void testApiNamingConventions() throws Exception {
724
724
assertEquals (0 , method .getExceptionTypes ().length );
725
725
assertEquals (3 , method .getParameterTypes ().length );
726
726
assertThat (method .getParameterTypes ()[0 ].getSimpleName (), endsWith ("Request" ));
727
- assertThat (method .getParameterTypes ()[1 ]. getName () , equalTo (RequestOptions .class . getName () ));
728
- assertThat (method .getParameterTypes ()[2 ]. getName () , equalTo (ActionListener .class . getName () ));
727
+ assertThat (method .getParameterTypes ()[1 ], equalTo (RequestOptions .class ));
728
+ assertThat (method .getParameterTypes ()[2 ], equalTo (ActionListener .class ));
729
729
} else {
730
730
//A few methods return a boolean rather than a response object
731
731
if (apiName .equals ("ping" ) || apiName .contains ("exist" )) {
@@ -738,18 +738,23 @@ public void testApiNamingConventions() throws Exception {
738
738
//a few methods don't accept a request object as argument
739
739
if (apiName .equals ("ping" ) || apiName .equals ("info" )) {
740
740
assertEquals (1 , method .getParameterTypes ().length );
741
- assertThat (method .getParameterTypes ()[0 ]. getName () , equalTo (RequestOptions .class . getName () ));
741
+ assertThat (method .getParameterTypes ()[0 ], equalTo (RequestOptions .class ));
742
742
} else {
743
743
assertEquals (apiName , 2 , method .getParameterTypes ().length );
744
744
assertThat (method .getParameterTypes ()[0 ].getSimpleName (), endsWith ("Request" ));
745
- assertThat (method .getParameterTypes ()[1 ]. getName () , equalTo (RequestOptions .class . getName () ));
745
+ assertThat (method .getParameterTypes ()[1 ], equalTo (RequestOptions .class ));
746
746
}
747
747
748
748
boolean remove = apiSpec .remove (apiName );
749
- if (remove == false && deprecatedMethods .contains (apiName ) == false ) {
750
- //TODO xpack api are currently ignored, we need to load xpack yaml spec too
751
- if (apiName .startsWith ("xpack." ) == false ) {
752
- apiNotFound .add (apiName );
749
+ if (remove == false ) {
750
+ if (deprecatedMethods .contains (apiName )) {
751
+ assertTrue ("method [" + method .getName () + "], api [" + apiName + "] should be deprecated" ,
752
+ method .isAnnotationPresent (Deprecated .class ));
753
+ } else {
754
+ //TODO xpack api are currently ignored, we need to load xpack yaml spec too
755
+ if (apiName .startsWith ("xpack." ) == false ) {
756
+ apiNotFound .add (apiName );
757
+ }
753
758
}
754
759
}
755
760
}
0 commit comments