@@ -24,21 +24,19 @@ class JmxScraperTest {
2424 void shouldThrowExceptionWhenInvalidCommandLineArgsProvided () {
2525 // Given
2626 List <String > emptyArgs = Collections .singletonList ("-nonExistentOption" );
27- JmxScraperConfigFactory configFactoryMock = mock (JmxScraperConfigFactory .class );
2827
2928 // When and Then
30- assertThatThrownBy (() -> JmxScraper .createConfigFromArgs (emptyArgs , configFactoryMock ))
29+ assertThatThrownBy (() -> JmxScraper .createConfigFromArgs (emptyArgs ))
3130 .isInstanceOf (ArgumentsParsingException .class );
3231 }
3332
3433 @ Test
3534 void shouldThrowExceptionWhenTooManyCommandLineArgsProvided () {
3635 // Given
3736 List <String > args = Arrays .asList ("-config" , "path" , "-nonExistentOption" );
38- JmxScraperConfigFactory configFactoryMock = mock (JmxScraperConfigFactory .class );
3937
4038 // When and Then
41- assertThatThrownBy (() -> JmxScraper .createConfigFromArgs (args , configFactoryMock ))
39+ assertThatThrownBy (() -> JmxScraper .createConfigFromArgs (args ))
4240 .isInstanceOf (ArgumentsParsingException .class );
4341 }
4442
@@ -49,10 +47,9 @@ void shouldCreateConfig_propertiesLoadedFromFile()
4947 String filePath =
5048 ClassLoader .getSystemClassLoader ().getResource ("validConfig.properties" ).getPath ();
5149 List <String > args = Arrays .asList ("-config" , filePath );
52- JmxScraperConfigFactory configFactory = new JmxScraperConfigFactory ();
5350
5451 // When
55- JmxScraperConfig config = JmxScraper .createConfigFromArgs (args , configFactory );
52+ JmxScraperConfig config = JmxScraper .createConfigFromArgs (args );
5653
5754 // Then
5855 assertThat (config ).isNotNull ();
@@ -67,10 +64,9 @@ void shouldCreateConfig_propertiesLoadedFromStdIn()
6764 // Given
6865 System .setIn (stream );
6966 List <String > args = Arrays .asList ("-config" , "-" );
70- JmxScraperConfigFactory configFactory = new JmxScraperConfigFactory ();
7167
7268 // When
73- JmxScraperConfig config = JmxScraper .createConfigFromArgs (args , configFactory );
69+ JmxScraperConfig config = JmxScraper .createConfigFromArgs (args );
7470
7571 // Then
7672 assertThat (config ).isNotNull ();
0 commit comments