no.unit.nva.testutils.TestHeaders Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nvatestutils Show documentation
Show all versions of nvatestutils Show documentation
A commons library for the NVA project
The newest version!
package no.unit.nva.testutils;
import static org.apache.http.HttpHeaders.ACCEPT;
import static org.apache.http.HttpHeaders.CONTENT_TYPE;
import java.util.Map;
import nva.commons.core.JacocoGenerated;
@SuppressWarnings("PMD.TestClassWithoutTestCases")
@JacocoGenerated
public final class TestHeaders {
public static final String ACCESS_CONTROL_ALLOW_ORIGIN = "Access-Control-Allow-Origin";
public static final String APPLICATION_JSON = "application/json";
public static final String APPLICATION_PROBLEM_JSON = "application/problem+json";
public static final String WILDCARD = "*";
private TestHeaders() {
}
/**
* Request headers for testing.
*
* @return headers
*/
public static Map getRequestHeaders() {
return Map.of(
CONTENT_TYPE, APPLICATION_JSON,
ACCEPT, APPLICATION_JSON);
}
/**
* Successful response headers for testing.
*
* @return headers
*/
public static Map getResponseHeaders() {
return Map.of(
CONTENT_TYPE, APPLICATION_JSON,
ACCESS_CONTROL_ALLOW_ORIGIN, WILDCARD
);
}
/**
* Failing response headers for testing.
*
* @return headers
*/
public static Map getErrorResponseHeaders() {
return Map.of(
CONTENT_TYPE, APPLICATION_PROBLEM_JSON,
ACCESS_CONTROL_ALLOW_ORIGIN, WILDCARD
);
}
}