Refine TestPropertySourceUtils for direct use

Update methods in TestPropertySourceUtils to accept var-args and allow
addInlinedProperties to be called more than once.

Issue: SPR-14088
This commit is contained in:
Phillip Webb
2016-03-25 11:10:47 -07:00
parent fee056a1b1
commit fc839331a7
2 changed files with 16 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -140,7 +140,7 @@ public class TestPropertySourceUtilsTests {
public void addInlinedPropertiesToEnvironmentWithContextAndNullInlinedProperties() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("inlined");
addInlinedPropertiesToEnvironment(mock(ConfigurableApplicationContext.class), null);
addInlinedPropertiesToEnvironment(mock(ConfigurableApplicationContext.class), (String[]) null);
}
/**
@@ -160,7 +160,7 @@ public class TestPropertySourceUtilsTests {
public void addInlinedPropertiesToEnvironmentWithEnvironmentAndNullInlinedProperties() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("inlined");
addInlinedPropertiesToEnvironment(new MockEnvironment(), null);
addInlinedPropertiesToEnvironment(new MockEnvironment(), (String[]) null);
}
/**
@@ -202,7 +202,7 @@ public class TestPropertySourceUtilsTests {
public void convertInlinedPropertiesToMapWithNullInlinedProperties() {
expectedException.expect(IllegalArgumentException.class);
expectedException.expectMessage("inlined");
convertInlinedPropertiesToMap(null);
convertInlinedPropertiesToMap((String[]) null);
}
// -------------------------------------------------------------------