@@ -208,42 +208,6 @@ public void shouldGenerateCustomPropertiesFileProperties(boolean useNativeGit) t
208
208
@ Test
209
209
@ Parameters (method = "useNativeGit" )
210
210
public void shouldGenerateCustomPropertiesFileJson (boolean useNativeGit ) throws Exception {
211
- // given
212
- mavenSandbox .withParentProject ("my-pom-project" , "pom" )
213
- .withChildProject ("my-jar-module" , "jar" )
214
- .withGitRepoInChild (AvailableGitTestRepo .GIT_COMMIT_ID )
215
- .create (CleanUp .CLEANUP_FIRST );
216
-
217
- MavenProject targetProject = mavenSandbox .getChildProject ();
218
-
219
- String targetFilePath = "target/classes/custom-git.properties" ;
220
- File expectedFile = new File (targetProject .getBasedir (), targetFilePath );
221
-
222
- setProjectToExecuteMojoIn (targetProject );
223
- alterMojoSettings ("generateGitPropertiesFile" , true );
224
- alterMojoSettings ("generateGitPropertiesFilename" , targetFilePath );
225
- alterMojoSettings ("format" , "json" );
226
- alterMojoSettings ("useNativeGit" , useNativeGit );
227
-
228
- // when
229
- try {
230
- mojo .execute ();
231
-
232
- // then
233
- assertThat (expectedFile ).exists ();
234
- String json = Files .toString (expectedFile , Charset .defaultCharset ());
235
- ObjectMapper om = new ObjectMapper ();
236
- Map <String , String > map = new HashMap <String , String >();
237
- map = om .readValue (expectedFile , map .getClass ());
238
- assertThat (map .size () > 10 );
239
- } finally {
240
- FileUtils .forceDelete (expectedFile );
241
- }
242
- }
243
-
244
- @ Test
245
- @ Parameters (value = {"UTF-8" , "ISO-8859-1" })
246
- public void shouldGenerateCustomPropertiesFileJsonWithCustomEncoding (String encoding ) throws Exception {
247
211
// given
248
212
mavenSandbox .withParentProject ("my-pom-project" , "pom" )
249
213
.withChildProject ("my-jar-module" , "jar" )
@@ -254,21 +218,19 @@ public void shouldGenerateCustomPropertiesFileJsonWithCustomEncoding(String enco
254
218
255
219
String targetFilePath = "target/classes/custom-git.properties" ;
256
220
File expectedFile = new File (targetProject .getBasedir (), targetFilePath );
257
- Charset charset = Charset .forName (encoding );
258
221
259
222
setProjectToExecuteMojoIn (targetProject );
260
223
alterMojoSettings ("generateGitPropertiesFile" , true );
261
224
alterMojoSettings ("generateGitPropertiesFilename" , targetFilePath );
262
225
alterMojoSettings ("format" , "json" );
263
- alterMojoSettings ("useNativeGit" , true );
264
- alterMojoSettings ("encoding" , charset .name ());
226
+ alterMojoSettings ("useNativeGit" , useNativeGit );
265
227
// when
266
228
try {
267
229
mojo .execute ();
268
230
269
231
// then
270
232
assertThat (expectedFile ).exists ();
271
- String json = Files .toString (expectedFile , charset );
233
+ String json = Files .toString (expectedFile , Charset . forName ( "UTF-8" ) );
272
234
ObjectMapper om = new ObjectMapper ();
273
235
Map <String , String > map = new HashMap <String , String >();
274
236
map = om .readValue (json , map .getClass ());
0 commit comments