DirectXDRWebServiceImpl { public RegistryResponseType provideAndRegisterDocumentSet(ProvideAndRegisterDocumentSetRequestType body, WebServiceContext wsContext) throws Exception { RegistryResponseType resp; this.context = wsContext; DirectHeaderExtractor extractor = new DirectHeaderExtractor(); SoapDirectEdgeOrchestration orch = new SoapDirectEdgeOrchestration(); resp = orch.orchestrate(body, extractor.getHeaderProperties(wsContext)); return resp; }  RegistryResponseType provideAndRegisterDocumentSet(ProvideAndRegisterDocumentSetRequestType body,
            WebServiceContext wsContext);  }
@Test(expected=DirectException.class) public void testProvideAndRegisterDocumentSet_Failure1() throws Exception { WebServiceContext mockWSContext = mock(WebServiceContext.class); DirectHeaderExtractor mockExtractor = mock(DirectHeaderExtractor.class); SoapEdgeContext mockSoap = mock(SoapEdgeContext.class); ProvideAndRegisterDocumentSetRequestType mockBody = mock(ProvideAndRegisterDocumentSetRequestType.class); DirectXDRWebServiceImpl instance = new DirectXDRWebServiceImpl(); when(mockExtractor.getHeaderProperties(mockWSContext)).thenReturn(mockSoap); RegistryResponseType oResponse = instance.provideAndRegisterDocumentSet(mockBody, mockWSContext); assertNull(oResponse); }
@Test(expected=DirectException.class) public void testProvideAndRegisterDocumentSet_Failure2() throws Exception { WebServiceContext mockWSContext = mock(WebServiceContext.class); DirectHeaderExtractor mockExtractor = mock(DirectHeaderExtractor.class); SoapEdgeContext mockSoap = mock(SoapEdgeContext.class); ProvideAndRegisterDocumentSetRequestType body = new ProvideAndRegisterDocumentSetRequestType(); Document e = mock(Document.class); body.getDocument().add(e); SubmitObjectsRequest oSubmit = mock(SubmitObjectsRequest.class); body.setSubmitObjectsRequest(oSubmit); DirectXDRWebServiceImpl instance = new DirectXDRWebServiceImpl(); when(mockExtractor.getHeaderProperties(mockWSContext)).thenReturn(mockSoap); RegistryResponseType oResponse = instance.provideAndRegisterDocumentSet(body, mockWSContext); assertNull(oResponse); }