Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import org.codehaus.plexus.configuration.DefaultPlexusConfiguration;
import org.codehaus.plexus.util.Os;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import static org.codehaus.plexus.testing.PlexusExtension.getTestFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down Expand Up @@ -291,6 +293,34 @@ void testValueExtractionFromSystemPropertiesWithMissingProject() throws Exceptio
assertEquals("value", value);
}

@ParameterizedTest
@ValueSource(
strings = {
"prefix-${PPEET_nonexisting_ps_property}",
"${PPEET_nonexisting_ps_property}-suffix",
"prefix-${PPEET_nonexisting_ps_property}-suffix",
})
void testValueExtractionOfMissingPrefixedSuffixedProperty(String missingPropertyExpression) throws Exception {
Properties executionProperties = new Properties();

ExpressionEvaluator ee = createExpressionEvaluator(null, null, executionProperties);

Object value = ee.evaluate(missingPropertyExpression);

assertEquals(missingPropertyExpression, value);
}

@Test
void testValueExtractionOfMissingProperty() throws Exception {
Properties executionProperties = new Properties();

ExpressionEvaluator ee = createExpressionEvaluator(null, null, executionProperties);

Object value = ee.evaluate("${PPEET_nonexisting_property}");

assertNull(value);
}

@Test
void testValueExtractionFromSystemPropertiesWithMissingProject_WithDotNotation() throws Exception {
String sysprop = "PPEET.sysprop2";
Expand Down