Add a disabled JAX-RS test

This commit is contained in:
James Agnew 2016-03-12 14:16:00 -05:00
parent ce253bed70
commit 270ba270cc
2 changed files with 13 additions and 6 deletions

View File

@ -350,13 +350,17 @@ public class AbstractJaxRsResourceProviderTest {
compareResultId(1, patientCaptor.getValue());
}
@Test
@SuppressWarnings("unchecked")
@Ignore
public void testUpdateByWrongId() throws Exception {
when(mock.update(idCaptor.capture(), patientCaptor.capture())).thenReturn(new MethodOutcome());
client.update("1", createPatient(2));
assertEquals("1", idCaptor.getValue().getIdPart());
compareResultId(1, patientCaptor.getValue());
@Test
public void testResourceNotFound() throws Exception {
when(mock.update(idCaptor.capture(), patientCaptor.capture())).thenThrow(ResourceNotFoundException.class);
try {
client.update("1", createPatient(2));
fail();
} catch (ResourceNotFoundException e) {
// good
}
}
@Test

View File

@ -3,6 +3,7 @@ package ca.uhn.fhir.jaxrs.server.test;
import java.util.List;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
@ -14,6 +15,7 @@ import javax.ws.rs.core.Response;
import org.mockito.Mockito;
import ca.uhn.fhir.jaxrs.server.AbstractJaxRsResourceProvider;
import ca.uhn.fhir.jaxrs.server.interceptor.JaxRsExceptionInterceptor;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.dstu2.resource.Parameters;
import ca.uhn.fhir.model.dstu2.resource.Patient;
@ -45,6 +47,7 @@ import ca.uhn.fhir.rest.server.IPagingProvider;
@Path(TestJaxRsMockPatientRestProvider.PATH)
@Stateless
@Produces({ MediaType.APPLICATION_JSON, Constants.CT_FHIR_JSON, Constants.CT_FHIR_XML })
@Interceptors(JaxRsExceptionInterceptor.class)
public class TestJaxRsMockPatientRestProvider extends AbstractJaxRsResourceProvider<Patient> {
static final String PATH = "/Patient";