According to information from ShrinkWrap developers https://community.jboss.org/message/781880#781880 this is not yet implemented.
The ticket for this feature https://issues.jboss.org/browse/SHRINKRES-100
Вопрос
How to build Arquillian ShrinkWrap deployment that will execute Maven resource filtering? Which version of ShrinkWrap should I use?
Решение
According to information from ShrinkWrap developers https://community.jboss.org/message/781880#781880 this is not yet implemented.
The ticket for this feature https://issues.jboss.org/browse/SHRINKRES-100
Другие советы
After trying to "fix" it, it turns out the answer is quite simple...
webArchive.addAsResource("test.properties");
... will use a classpath resource that maven has already filtered.
EDIT: see my other answer, this is actually implemented and simple to use ;-)
Grzegorz is correct, this isn't implemented in Arquillian.
As a workaround, I ended up with this in @Deployment:
Properties testProperties = new Properties();
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
InputStream testPropertiesInputStream = contextClassLoader.getResourceAsStream("test.properties");
testProperties.load(testPropertiesInputStream);
File testPropertiesTargetFile = File.createTempFile("arquillian_test_", ".properties");
try (Writer testPropertiesWriter = Files.newBufferedWriter(testPropertiesTargetFile.toPath())) {
testProperties.store(testPropertiesWriter, null);
}
webArchive.addAsResource(testPropertiesTargetFile, "test.properties");
And this in @Setup:
private Properties testProperties;
@Before
public void setUp() throws IOException {
testProperties = new Properties();
InputStream testPropertiesInputStream = this.getClass().getResourceAsStream("/test.properties");
testProperties.load(testPropertiesInputStream);
}