Remove duplicate constant
This commit is contained in:
parent
27cac16de6
commit
9dd42fa605
|
@ -60,11 +60,7 @@ public class Constants {
|
||||||
public static final String CT_FHIR_JSON_NEW = "application/fhir+json";
|
public static final String CT_FHIR_JSON_NEW = "application/fhir+json";
|
||||||
public static final String CT_FHIR_XML = "application/xml+fhir";
|
public static final String CT_FHIR_XML = "application/xml+fhir";
|
||||||
|
|
||||||
/**
|
|
||||||
* Special Conformance Formats that don't follow normal mediatype rules
|
|
||||||
*/
|
|
||||||
public static final String CT_JSON_RAW = "json";
|
|
||||||
public static final String CT_XML_RAW = "xml";
|
|
||||||
/**
|
/**
|
||||||
* The FHIR MimeType for XML encoding in FHIR DSTU3+
|
* The FHIR MimeType for XML encoding in FHIR DSTU3+
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -224,8 +224,8 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState
|
||||||
retVal.getSoftware().setVersion(serverConfiguration.getServerVersion());
|
retVal.getSoftware().setVersion(serverConfiguration.getServerVersion());
|
||||||
retVal.addFormat(Constants.CT_FHIR_XML_NEW);
|
retVal.addFormat(Constants.CT_FHIR_XML_NEW);
|
||||||
retVal.addFormat(Constants.CT_FHIR_JSON_NEW);
|
retVal.addFormat(Constants.CT_FHIR_JSON_NEW);
|
||||||
retVal.addFormat(Constants.CT_JSON_RAW);
|
retVal.addFormat(Constants.FORMAT_JSON);
|
||||||
retVal.addFormat(Constants.CT_XML_RAW);
|
retVal.addFormat(Constants.FORMAT_XML);
|
||||||
retVal.setStatus(PublicationStatus.ACTIVE);
|
retVal.setStatus(PublicationStatus.ACTIVE);
|
||||||
|
|
||||||
CapabilityStatementRestComponent rest = retVal.addRest();
|
CapabilityStatementRestComponent rest = retVal.addRest();
|
||||||
|
|
|
@ -189,9 +189,9 @@ public class ServerCapabilityStatementProviderDstu3Test {
|
||||||
|
|
||||||
List<String> formatCodes = serverConformance.getFormat().stream().map(c -> c.asStringValue()).collect(Collectors.toList());;
|
List<String> formatCodes = serverConformance.getFormat().stream().map(c -> c.asStringValue()).collect(Collectors.toList());;
|
||||||
|
|
||||||
assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_JSON_RAW));
|
assertThat(formatCodes, hasItem(Constants.FORMAT_XML));
|
||||||
assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_XML_RAW));
|
assertThat(formatCodes, hasItem(Constants.FORMAT_JSON));
|
||||||
assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_FHIR_JSON_NEW));
|
assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW));
|
||||||
assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW));
|
assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,8 +172,8 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState
|
||||||
retVal.getSoftware().setVersion(configuration.getServerVersion());
|
retVal.getSoftware().setVersion(configuration.getServerVersion());
|
||||||
retVal.addFormat(Constants.CT_FHIR_XML_NEW);
|
retVal.addFormat(Constants.CT_FHIR_XML_NEW);
|
||||||
retVal.addFormat(Constants.CT_FHIR_JSON_NEW);
|
retVal.addFormat(Constants.CT_FHIR_JSON_NEW);
|
||||||
retVal.addFormat(Constants.CT_JSON_RAW);
|
retVal.addFormat(Constants.FORMAT_JSON);
|
||||||
retVal.addFormat(Constants.CT_XML_RAW);
|
retVal.addFormat(Constants.FORMAT_XML);
|
||||||
retVal.setStatus(PublicationStatus.ACTIVE);
|
retVal.setStatus(PublicationStatus.ACTIVE);
|
||||||
|
|
||||||
CapabilityStatementRestComponent rest = retVal.addRest();
|
CapabilityStatementRestComponent rest = retVal.addRest();
|
||||||
|
|
|
@ -541,10 +541,10 @@ public class ServerCapabilityStatementProviderR4Test {
|
||||||
rs.init(createServletConfig());
|
rs.init(createServletConfig());
|
||||||
CapabilityStatement serverConformance = sc.getServerConformance(createHttpServletRequest(), createRequestDetails(rs));
|
CapabilityStatement serverConformance = sc.getServerConformance(createHttpServletRequest(), createRequestDetails(rs));
|
||||||
|
|
||||||
List<String> formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList());;
|
List<String> formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList());
|
||||||
|
|
||||||
assertThat(formatCodes, hasItem(Constants.CT_JSON_RAW));
|
assertThat(formatCodes, hasItem(Constants.FORMAT_XML));
|
||||||
assertThat(formatCodes, hasItem(Constants.CT_XML_RAW));
|
assertThat(formatCodes, hasItem(Constants.FORMAT_JSON));
|
||||||
assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW));
|
assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW));
|
||||||
assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW));
|
assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW));
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,8 +184,8 @@ public class ServerCapabilityStatementProvider extends BaseServerCapabilityState
|
||||||
retVal.getSoftware().setVersion(configuration.getServerVersion());
|
retVal.getSoftware().setVersion(configuration.getServerVersion());
|
||||||
retVal.addFormat(Constants.CT_FHIR_XML_NEW);
|
retVal.addFormat(Constants.CT_FHIR_XML_NEW);
|
||||||
retVal.addFormat(Constants.CT_FHIR_JSON_NEW);
|
retVal.addFormat(Constants.CT_FHIR_JSON_NEW);
|
||||||
retVal.addFormat(Constants.CT_JSON_RAW);
|
retVal.addFormat(Constants.FORMAT_JSON);
|
||||||
retVal.addFormat(Constants.CT_XML_RAW);
|
retVal.addFormat(Constants.FORMAT_XML);
|
||||||
retVal.setStatus(PublicationStatus.ACTIVE);
|
retVal.setStatus(PublicationStatus.ACTIVE);
|
||||||
|
|
||||||
CapabilityStatementRestComponent rest = retVal.addRest();
|
CapabilityStatementRestComponent rest = retVal.addRest();
|
||||||
|
|
|
@ -214,9 +214,9 @@ public class ServerCapabilityStatementProviderR5Test {
|
||||||
|
|
||||||
List<String> formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList());;
|
List<String> formatCodes = serverConformance.getFormat().stream().map(c -> c.getCode()).collect(Collectors.toList());;
|
||||||
|
|
||||||
assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_JSON_RAW));
|
assertThat(formatCodes, hasItem(Constants.FORMAT_XML));
|
||||||
assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_XML_RAW));
|
assertThat(formatCodes, hasItem(Constants.FORMAT_JSON));
|
||||||
assertThat(formatCodes, hasItem(ca.uhn.fhir.rest.api.Constants.CT_FHIR_JSON_NEW));
|
assertThat(formatCodes, hasItem(Constants.CT_FHIR_JSON_NEW));
|
||||||
assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW));
|
assertThat(formatCodes, hasItem(Constants.CT_FHIR_XML_NEW));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue