// Path: src/test/java/pl/jalokim/propertiestojson/domain/MainObject.java
// @Getter
// @Setter
// public class MainObject {
// 
//     private Man man;
//     private Insurance insurance;
//     private String field1;
//     private String field2;
// }


import com.google.gson.Gson;
import java.io.IOException;
import java.io.InputStream;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import pl.jalokim.propertiestojson.domain.MainObject;
package pl.jalokim.propertiestojson.util;


public class PropertiesToJsonConverterFilterTest extends AbstractPropertiesToJsonConverterTest {

    @Test
    public void parsePropertiesOnlyByIncludedKeys() {
        //when
        String json = new PropertiesToJsonConverter().convertToJson(initProperlyPropertiesMap(), "man.groups", "man.hoobies", "insurance.cost");
        // then
        assertJsonIsAsExpected(json);
    }

    @Test
    public void parseInputStreamOnlyByIncludedKeys() throws IOException {
        // given
        InputStream inputStream = getPropertiesFromFile();
        // when
        String json = new PropertiesToJsonConverter().convertToJson(inputStream, "man.groups", "man.hoobies", "insurance.cost");
        // then
        assertJsonIsAsExpected(json);
    }

    private void assertJsonIsAsExpected(String json) {
        Gson gson = new Gson();
// Path: src/test/java/pl/jalokim/propertiestojson/domain/MainObject.java
// @Getter
// @Setter
// public class MainObject {
// 
//     private Man man;
//     private Insurance insurance;
//     private String field1;
//     private String field2;
// }


// Path: src/test/java/pl/jalokim/propertiestojson/util/PropertiesToJsonConverterFilterTest.java
import com.google.gson.Gson;
import java.io.IOException;
import java.io.InputStream;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import pl.jalokim.propertiestojson.domain.MainObject;

package pl.jalokim.propertiestojson.util;


public class PropertiesToJsonConverterFilterTest extends AbstractPropertiesToJsonConverterTest {

    @Test
    public void parsePropertiesOnlyByIncludedKeys() {
        //when
        String json = new PropertiesToJsonConverter().convertToJson(initProperlyPropertiesMap(), "man.groups", "man.hoobies", "insurance.cost");
        // then
        assertJsonIsAsExpected(json);
    }

    @Test
    public void parseInputStreamOnlyByIncludedKeys() throws IOException {
        // given
        InputStream inputStream = getPropertiesFromFile();
        // when
        String json = new PropertiesToJsonConverter().convertToJson(inputStream, "man.groups", "man.hoobies", "insurance.cost");
        // then
        assertJsonIsAsExpected(json);
    }

    private void assertJsonIsAsExpected(String json) {
        Gson gson = new Gson();
        MainObject mainObject = gson.fromJson(json, MainObject.class);