Fix potential NPE with unknown Spring Boot starter

Fixes gh-41
This commit is contained in:
Stephane Nicoll
2014-10-25 15:15:46 +02:00
parent 109f93424b
commit 5f0bb06e8f
2 changed files with 6 additions and 0 deletions

View File

@@ -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
}
/**

View File

@@ -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