use of org.nhindirect.common.rest.exceptions.ServiceMethodException in project nhin-d by DirectProject.
the class UnsecuredServiceRequestBase_interpretResponseTest method testInterpretResponseTest_404Status_assertServiceMethodException.
@Test
public void testInterpretResponseTest_404Status_assertServiceMethodException() throws Exception {
MockServiceRequest req = new MockServiceRequest(null, "http://service/svc", "Test");
HttpResponse resp = mock(HttpResponse.class);
boolean exceptionOccured = false;
try {
req.interpretResponse(404, resp);
} catch (ServiceMethodException e) {
assertEquals(404, e.getResponseCode());
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.common.rest.exceptions.ServiceMethodException in project nhin-d by DirectProject.
the class UnsecuredServiceRequestBase_interpretResponseTest method testInterpretResponseTest_400Status_assertServiceMethodException.
@Test
public void testInterpretResponseTest_400Status_assertServiceMethodException() throws Exception {
MockServiceRequest req = new MockServiceRequest(null, "http://service/svc", "Test");
HttpResponse resp = mock(HttpResponse.class);
boolean exceptionOccured = false;
try {
req.interpretResponse(400, resp);
} catch (ServiceMethodException e) {
assertEquals(400, e.getResponseCode());
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.common.rest.exceptions.ServiceMethodException in project nhin-d by DirectProject.
the class UnsecuredServiceRequestBase_interpretResponseTest method testInterpretResponseTest_500Status_assertServiceMethodException.
@Test
public void testInterpretResponseTest_500Status_assertServiceMethodException() throws Exception {
MockServiceRequest req = new MockServiceRequest(null, "http://service/svc", "Test");
HttpResponse resp = mock(HttpResponse.class);
boolean exceptionOccured = false;
try {
req.interpretResponse(500, resp);
} catch (ServiceMethodException e) {
assertEquals(500, e.getResponseCode());
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations