All Downloads are FREE. Search and download functionalities are using the official Maven repository.

automation.library.conversion2jmx.postman2jmx.utils.PostmanCollectionUtils Maven / Gradle / Ivy

Go to download

The 'conversion2jmx' library to helps creating JMeter JMX files from different sources

The newest version!
package automation.library.conversion2jmx.postman2jmx.utils;

import automation.library.conversion2jmx.postman2jmx.model.postman.PostmanCollection;
import automation.library.conversion2jmx.postman2jmx.model.postman.PostmanItem;

import java.util.ArrayList;
import java.util.List;

public class PostmanCollectionUtils {

    private static void getItem(PostmanItem item, List itemList) {
        if (item.getItems().size() == 0 && item.getRequest() != null) {
            itemList.add(item);
        }

        for (PostmanItem i : item.getItems()) {
            getItem(i, itemList);
        }
    }

    public static List getItems(PostmanCollection postmanCollection) {
        List items = new ArrayList<>();

        for (PostmanItem item : postmanCollection.getItems()) {
            getItem(item, items);
        }
        return items;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy