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

io.mstream.trader.commons.test.util.HttpUtil Maven / Gradle / Ivy

There is a newer version: 1.14
Show newest version
package io.mstream.trader.commons.test.util;

import static java.lang.String.format;

public class HttpUtil {

    public static int featureToHttpStatus(String featureStatus) {
        switch (featureStatus) {
            case "OK":
                return 200;
            case "NOT_FOUND":
                return 404;
            case "INTERNAL_SERVER_ERROR":
                return 500;
            case "SERVICE_UNAVAILABLE":
                return 503;
        }
        throw new IllegalArgumentException(
                format("no status mapping found for '%s'", featureStatus));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy