In a Maven application I need to test a method with a different encoding and just one of them. The others must use the encoding provided by System.getProperty("file.encoding")
.
For example:
@Test
public void test1() {...} // regular encoding
@Test
public void test2() {...} // regular encoding
@Test
public void test3() {...} // regular encoding
[...]
@Test
public void testEncoding() {...} // custom encoding!!!
I cannot change the encoding with System.setProperty("file.encoding", "...")
because is cached and I want a procedure that can be versionable (i.e. independent by an IDE like IDEA or Eclipse and working for anyone has downloaded the code).
Is there any way via JUnit or Maven plugin to do so?