mirror of
https://gitee.com/dcren/initializr.git
synced 2026-02-26 13:43:15 +08:00
Fix potential NPE with unknown Spring Boot starter
Fixes gh-41
This commit is contained in:
@@ -223,6 +223,7 @@ class InitializrMetadata {
|
||||
def asSpringBootStarter(String name) {
|
||||
groupId = 'org.springframework.boot'
|
||||
artifactId = StringUtils.hasText(name) ? 'spring-boot-starter-' + name : 'spring-boot-starter'
|
||||
id = name
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -144,6 +144,11 @@ class MainControllerIntegrationTests extends AbstractInitializrControllerIntegra
|
||||
slurper.parseText(restTemplate.getForObject(createUrl('/metrics'), String))
|
||||
}
|
||||
|
||||
@Test
|
||||
void downloadWithUnknownSpringBootStarter() { // Simple id are accepted as spring-boot-starter
|
||||
downloadZip('/starter.zip?style=foo').pomAssert().hasSpringBootStarterDependency('foo')
|
||||
}
|
||||
|
||||
// Existing tests for backward compatibility
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user