@Test public void readFromBuilder() throws ConfigurationException { // Arrange final FileBasedBuilderParameters params = new Parameters() .fileBased() .setThrowExceptionOnMissing(true) .setEncoding("UTF-8") .setFileName(Resources.getResource("example.json").toString()); // Act final FileBasedConfigurationBuilder<JsonConfiguration> builder = new FileBasedConfigurationBuilder<>( JsonConfiguration.class); final JsonConfiguration sut = builder.configure(params).getConfiguration(); // Assert assertThat(sut.getString("name"), is("testName")); }