Potential solution for #47 (bad test)
This commit is contained in:
parent
5aafeee3d3
commit
1bd51f6118
|
@ -15,6 +15,7 @@ import java.nio.charset.Charset;
|
|||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.io.input.ReaderInputStream;
|
||||
|
@ -525,17 +526,16 @@ public class ClientTest {
|
|||
|
||||
ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo");
|
||||
|
||||
client.getHistoryPatientInstance(new IdDt("111"), new InstantDt("2012-01-02T00:01:02"), new IntegerDt(12));
|
||||
// ensures the local timezone
|
||||
String expectedDateString = new InstantDt(new InstantDt("2012-01-02T12:01:02").getValue()).getValueAsString();
|
||||
expectedDateString = expectedDateString.replace(":", "%3A").replace("+", "%2B");
|
||||
|
||||
client.getHistoryPatientInstance(new IdDt("111"), new InstantDt("2012-01-02T12:01:02"), new IntegerDt(12));
|
||||
assertThat(capt.getAllValues().get(0).getURI().toString(), containsString("http://foo/Patient/111/_history?"));
|
||||
assertThat(capt.getAllValues().get(0).getURI().toString(), containsString("_since=2012-01-02T00%3A01%3A02"));
|
||||
assertThat(capt.getAllValues().get(0).getURI().toString(), containsString("_since="+expectedDateString.replaceAll("\\..*", "")));
|
||||
assertThat(capt.getAllValues().get(0).getURI().toString(), containsString("_count=12"));
|
||||
|
||||
String expectedDateString = new InstantDt(new InstantDt("2012-01-02T00:01:02").getValue()).getValueAsString(); // ensures
|
||||
// the
|
||||
// local
|
||||
// timezone
|
||||
expectedDateString = expectedDateString.replace(":", "%3A");
|
||||
client.getHistoryPatientInstance(new IdDt("111"), new InstantDt("2012-01-02T00:01:02").getValue(), new IntegerDt(12).getValue());
|
||||
client.getHistoryPatientInstance(new IdDt("111"), new InstantDt("2012-01-02T12:01:02").getValue(), new IntegerDt(12).getValue());
|
||||
assertThat(capt.getAllValues().get(1).getURI().toString(), containsString("http://foo/Patient/111/_history?"));
|
||||
assertThat(capt.getAllValues().get(1).getURI().toString(), containsString("_since="+expectedDateString));
|
||||
assertThat(capt.getAllValues().get(1).getURI().toString(), containsString("_count=12"));
|
||||
|
|
Loading…
Reference in New Issue