|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
/*
|
|
|
|
|
* Copyright 2012-2021 the original author or authors.
|
|
|
|
|
* Copyright 2012-2022 the original author or authors.
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
@ -33,6 +33,7 @@ import org.springframework.boot.gradle.junit.GradleProjectBuilder;
|
|
|
|
|
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tests for {@link BuildInfo}.
|
|
|
|
@ -186,6 +187,14 @@ class BuildInfoTests {
|
|
|
|
|
assertThat(buildInfoProperties(task)).containsEntry("build.b", "bravo");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void nullAdditionalPropertyProducesInformativeFailure() {
|
|
|
|
|
BuildInfo task = createTask(createProject("test"));
|
|
|
|
|
task.getProperties().getAdditional().put("a", null);
|
|
|
|
|
assertThatThrownBy(() -> buildInfoProperties(task))
|
|
|
|
|
.hasMessage("Additional property 'a' is illegal as its value is null");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Project createProject(String projectName) {
|
|
|
|
|
File projectDir = new File(this.temp, projectName);
|
|
|
|
|
Project project = GradleProjectBuilder.builder().withProjectDir(projectDir).withName(projectName).build();
|
|
|
|
|