(context: ResolutionContext)
| 22 | }, |
| 23 | |
| 24 | detect(context: ResolutionContext): boolean { |
| 25 | // Check for pom.xml with Spring |
| 26 | const pomXml = context.readFile('pom.xml'); |
| 27 | if (pomXml && (pomXml.includes('spring-boot') || pomXml.includes('springframework'))) { |
| 28 | return true; |
| 29 | } |
| 30 | |
| 31 | // Check for build.gradle with Spring |
| 32 | const buildGradle = context.readFile('build.gradle'); |
| 33 | if (buildGradle && (buildGradle.includes('spring-boot') || buildGradle.includes('springframework'))) { |
| 34 | return true; |
| 35 | } |
| 36 | |
| 37 | const buildGradleKts = context.readFile('build.gradle.kts'); |
| 38 | if (buildGradleKts && (buildGradleKts.includes('spring-boot') || buildGradleKts.includes('springframework'))) { |
| 39 | return true; |
| 40 | } |
| 41 | |
| 42 | // Check for Spring annotations in Java files |
| 43 | const allFiles = context.getAllFiles(); |
| 44 | for (const file of allFiles) { |
| 45 | if (file.endsWith('.java')) { |
| 46 | const content = context.readFile(file); |
| 47 | if (content && ( |
| 48 | content.includes('@SpringBootApplication') || |
| 49 | content.includes('@RestController') || |
| 50 | content.includes('@Service') || |
| 51 | content.includes('@Repository') |
| 52 | )) { |
| 53 | return true; |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | return false; |
| 59 | }, |
| 60 | |
| 61 | resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 62 | // A route's handler is the method its mapping annotation is written on, |
nothing calls this directly
no test coverage detected