| 1191 | |
| 1192 | #[test] |
| 1193 | fn test_static_method() { |
| 1194 | let mut parser = JavaParser::new(); |
| 1195 | let source = r#" |
| 1196 | public class MathUtils { |
| 1197 | public static int add(int a, int b) { |
| 1198 | return a + b; |
| 1199 | } |
| 1200 | } |
| 1201 | "#; |
| 1202 | let entities = parser.extract(source, "MathUtils.java"); |
| 1203 | let add = entities.iter().find(|e| e.name == "add").unwrap(); |
| 1204 | assert!( |
| 1205 | add.signature.as_ref().unwrap().contains("static"), |
| 1206 | "Should contain static in signature: {:?}", |
| 1207 | add.signature |
| 1208 | ); |
| 1209 | } |
| 1210 | |
| 1211 | #[test] |
| 1212 | fn test_multiple_classes_in_file() { |