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

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

The 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 "BAD_REQUEST":
                return 400;
            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 - 2024 Weber Informatics LLC | Privacy Policy