Fix more unit tests for #380

This commit is contained in:
James Agnew 2016-06-10 18:56:41 -05:00
parent 035ed27dab
commit fd8d67b9cd
9 changed files with 18 additions and 22 deletions

View File

@ -70,7 +70,7 @@ public class AbstractJaxRsConformanceProviderDstu3Test {
Response response = createConformanceProvider(providers).conformance();
assertEquals(Constants.STATUS_HTTP_200_OK, response.getStatus());
assertTrue(response.getEntity().toString().contains("\"type\":\"Patient\""));
assertTrue(response.getEntity().toString().contains("\"$someCustomOperation"));
assertTrue(response.getEntity().toString().contains("\"someCustomOperation"));
System.out.println(response);
System.out.println(response.getEntity());
}
@ -84,7 +84,7 @@ public class AbstractJaxRsConformanceProviderDstu3Test {
assertEquals(Constants.STATUS_HTTP_200_OK, response.getStatus());
System.out.println(response.getEntity());
assertTrue(response.getEntity().toString().contains(" <type value=\"Patient\"/>"));
assertTrue(response.getEntity().toString().contains("\"$someCustomOperation"));
assertTrue(response.getEntity().toString().contains("\"someCustomOperation"));
System.out.println(response.getEntity());
}

View File

@ -141,7 +141,7 @@ public class SystemProviderDstu2Test extends BaseJpaDstu2Test {
try {
String response = IOUtils.toString(http.getEntity().getContent());
ourLog.info(response);
assertThat(response, not(containsString("_format")));
assertThat(response, (containsString("_format=json")));
assertEquals(200, http.getStatusLine().getStatusCode());
} finally {
http.close();

View File

@ -315,7 +315,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test {
try {
String response = IOUtils.toString(http.getEntity().getContent());
ourLog.info(response);
assertThat(response, not(containsString("_format")));
assertThat(response, containsString("_format=json"));
assertEquals(200, http.getStatusLine().getStatusCode());
} finally {
http.close();
@ -454,7 +454,7 @@ public class SystemProviderDstu3Test extends BaseJpaDstu3Test {
@Test
public void testGetOperationDefinition() {
OperationDefinition op = ourClient.read(OperationDefinition.class, "get-resource-counts");
assertEquals("$get-resource-counts", op.getCode());
assertEquals("get-resource-counts", op.getCode());
}
@Test

View File

@ -163,7 +163,7 @@ public class BaseDateTimeDtDstu2Test {
@Test
public void testParseIgnoresLeadingAndTrailingSpace() {
DateTimeDt dt = new DateTimeDt(" 2014-10-11T12:11:00Z ");
assertEquals("", myDateInstantZoneParser.format(dt.getValue()));
assertEquals("2014-10-11 10:11:00.000-0200", myDateInstantZoneParser.format(dt.getValue()));
}
@Test

View File

@ -164,17 +164,17 @@ public class OperationServerWithSearchParamTypesDstu2Test {
assertThat(conf, stringContainsInOrder(
"<type value=\"Patient\"/>",
"<operation>",
"<name value=\"$andlist\"/>"
"<name value=\"andlist\"/>"
));
assertThat(conf, stringContainsInOrder(
"<type value=\"Patient\"/>",
"<operation>",
"<name value=\"$nonrepeating\"/>"
"<name value=\"nonrepeating\"/>"
));
assertThat(conf, stringContainsInOrder(
"<type value=\"Patient\"/>",
"<operation>",
"<name value=\"$orlist\"/>"
"<name value=\"orlist\"/>"
));
//@formatter:on

View File

@ -136,7 +136,7 @@ public class ServerConformanceProviderDstu2Test {
ourLog.info(conf);
assertEquals(1, conformance.getRest().get(0).getOperation().size());
assertEquals("$everything", conformance.getRest().get(0).getOperation().get(0).getName());
assertEquals("everything", conformance.getRest().get(0).getOperation().get(0).getName());
assertEquals("OperationDefinition/everything", conformance.getRest().get(0).getOperation().get(0).getDefinition().getReference().getValue());
}

View File

@ -376,7 +376,7 @@ public class ResponseHighlightingInterceptorTest {
ourLog.info(output);
assertThat(output, containsString("<span class='hlTagName'>Patient</span>"));
assertThat(output, not(stringContainsInOrder("<body>", "<pre>", "\n", "</pre>")));
assertThat(output, containsString("<a href=\"?_raw=true\">"));
assertThat(output, containsString("<a href=\"?_format=json\">"));
}
/**

View File

@ -174,18 +174,18 @@ public class OperationServerWithSearchParamTypesDstu3Test {
assertThat(conf, stringContainsInOrder(
"<type value=\"Patient\"/>",
"<operation>",
"<name value=\"$andlist\"/>",
"<name value=\"andlist\"/>",
"</operation>"
));
assertThat(conf, stringContainsInOrder(
"<type value=\"Patient\"/>",
"<operation>",
"<name value=\"$nonrepeating\"/>"
"<name value=\"nonrepeating\"/>"
));
assertThat(conf, stringContainsInOrder(
"<type value=\"Patient\"/>",
"<operation>",
"<name value=\"$orlist\"/>"
"<name value=\"orlist\"/>"
));
//@formatter:on

View File

@ -131,11 +131,10 @@ public class ServerConformanceProviderDstu3Test {
ourLog.info(conf);
assertEquals(1, conformance.getRest().get(0).getOperation().size());
assertEquals("$everything", conformance.getRest().get(0).getOperation().get(0).getName());
assertEquals("$everything", ((OperationDefinition)conformance.getRest().get(0).getOperation().get(0).getDefinition().getResource()).getCode());
assertEquals("everything", conformance.getRest().get(0).getOperation().get(0).getName());
OperationDefinition opDef = sc.readOperationDefinition(new IdType("OperationDefinition/everything"));
assertEquals("$everything", opDef.getCode());
assertEquals("everything", opDef.getCode());
}
@Test
@ -155,7 +154,7 @@ public class ServerConformanceProviderDstu3Test {
String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(opDef);
ourLog.info(conf);
assertEquals("$everything", opDef.getCode());
assertEquals("everything", opDef.getCode());
assertEquals(true, opDef.getIdempotent());
}
@ -269,15 +268,12 @@ public class ServerConformanceProviderDstu3Test {
rs.init(createServletConfig());
Conformance sconf = sc.getServerConformance(createHttpServletRequest());
assertEquals("$plain", ((OperationDefinition)sconf.getRest().get(0).getOperation().get(0).getDefinition().getResource()).getCode());
OperationDefinition opDef = sc.readOperationDefinition(new IdType("OperationDefinition/plain"));
String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(opDef);
ourLog.info(conf);
assertEquals("$plain", opDef.getCode());
assertEquals("plain", opDef.getCode());
assertEquals(true, opDef.getIdempotent());
assertEquals(3, opDef.getParameter().size());
assertEquals("start", opDef.getParameter().get(0).getName());