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));
}
}