diff options
author | Rob Daugherty <rd472p@att.com> | 2018-03-09 15:02:18 -0500 |
---|---|---|
committer | Rob Daugherty <rd472p@att.com> | 2018-03-09 15:08:14 -0500 |
commit | 96b5a685d0c3afddb632e4a68ca7483f933b55dc (patch) | |
tree | 246399de05a3d429bf45ef1e5af2b9b0218d99f3 /mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java | |
parent | 4475278c81668109b2b37a1d2720d8f2910641c4 (diff) |
Revert Reduce log noise/warnings
This reverts commit 327b17ab250b4c17cf3f91f5e4cd9bffd89f3d1e.
It is seriously impeding our ability complete the promised merge of AT&T
1802 code.
While I'm all for coding standards, if we are serious about using spaces
instead of tabs, then I think we need to (1) agree with the community when
this will happen, (2) do consistently in all files, and (3) enforce it.
Change-Id: Ib9b996f6b6c7d81ac9ac95d58b0c7d8cc39675ff
Issue-ID: SO-368
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java | 102 |
1 files changed, 54 insertions, 48 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java index 6fc396dd11..4e4f0ee189 100644 --- a/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java +++ b/mso-api-handlers/mso-api-handler-common/src/test/java/org/openecomp/mso/camunda/tests/BPELRestClientTest.java @@ -50,71 +50,77 @@ import org.openecomp.mso.properties.MsoJavaProperties; /** * This class implements test methods of Camunda Beans. + * + * */ public class BPELRestClientTest { - @Mock - private HttpClient mockHttpClient; - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - } + @Mock + private HttpClient mockHttpClient; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + } + + @Test + public void tesBPELPost() throws JsonGenerationException, + JsonMappingException, IOException { + - @Test - public void tesBPELPost() throws JsonGenerationException, - JsonMappingException, IOException { + String responseBody ="<layer3activate:service-response xmlns:layer3activate=\"http://org.openecomp/mso/request/layer3serviceactivate/schema/v1\"" + + "xmlns:reqtype=\"http://org.openecomp/mso/request/types/v1\"" + + "xmlns:aetgt=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\"" + + "xmlns:types=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\">" + + "<reqtype:request-id>req5</reqtype:request-id>" + + "<reqtype:request-action>Layer3ServiceActivateRequest</reqtype:request-action>" + + "<reqtype:source>OMX</reqtype:source>" + + "<reqtype:ack-final-indicator>n</reqtype:ack-final-indicator>" + + "</layer3activate:service-response>"; + + HttpResponse mockResponse = createResponse(200, responseBody); + mockHttpClient = Mockito.mock(HttpClient.class); + Mockito.when(mockHttpClient.execute(Mockito.any(HttpPost.class))) + .thenReturn(mockResponse); + String reqXML = "<xml>test</xml>"; + String orchestrationURI = "/active-bpel/services/REST/MsoLayer3ServiceActivate"; - String responseBody = "<layer3activate:service-response xmlns:layer3activate=\"http://org.openecomp/mso/request/layer3serviceactivate/schema/v1\"" - + "xmlns:reqtype=\"http://org.openecomp/mso/request/types/v1\"" - + "xmlns:aetgt=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\"" - + "xmlns:types=\"http://schemas.activebpel.org/REST/2007/12/01/aeREST.xsd\">" - + "<reqtype:request-id>req5</reqtype:request-id>" - + "<reqtype:request-action>Layer3ServiceActivateRequest</reqtype:request-action>" - + "<reqtype:source>OMX</reqtype:source>" - + "<reqtype:ack-final-indicator>n</reqtype:ack-final-indicator>" - + "</layer3activate:service-response>"; + MsoJavaProperties props = new MsoJavaProperties(); + props.setProperty(CommonConstants.BPEL_URL, "http://localhost:8089"); + props.setProperty("bpelAuth", "786864AA53D0DCD881AED1154230C0C3058D58B9339D2EFB6193A0F0D82530E1"); - HttpResponse mockResponse = createResponse(200, responseBody); - mockHttpClient = Mockito.mock(HttpClient.class); - Mockito.when(mockHttpClient.execute(Mockito.any(HttpPost.class))) - .thenReturn(mockResponse); + RequestClient requestClient = RequestClientFactory.getRequestClient(orchestrationURI, props); + requestClient.setClient(mockHttpClient); + HttpResponse response = requestClient.post(reqXML, "reqId", "timeout", "version", null, null); - String reqXML = "<xml>test</xml>"; - String orchestrationURI = "/active-bpel/services/REST/MsoLayer3ServiceActivate"; - MsoJavaProperties props = new MsoJavaProperties(); - props.setProperty(CommonConstants.BPEL_URL, "http://localhost:8089"); - props.setProperty("bpelAuth", "786864AA53D0DCD881AED1154230C0C3058D58B9339D2EFB6193A0F0D82530E1"); + int statusCode = response.getStatusLine().getStatusCode(); + assertEquals(requestClient.getType(), CommonConstants.BPEL); + assertEquals(statusCode, HttpStatus.SC_OK); - RequestClient requestClient = RequestClientFactory.getRequestClient(orchestrationURI, props); - requestClient.setClient(mockHttpClient); - HttpResponse response = requestClient.post(reqXML, "reqId", "timeout", "version", null, null); + } - int statusCode = response.getStatusLine().getStatusCode(); - assertEquals(requestClient.getType(), CommonConstants.BPEL); - assertEquals(statusCode, HttpStatus.SC_OK); + private HttpResponse createResponse(int respStatus, + String respBody) { + HttpResponse response = new BasicHttpResponse( + new BasicStatusLine( + new ProtocolVersion("HTTP", 1, 1), respStatus, "")); + response.setStatusCode(respStatus); + try { + response.setEntity(new StringEntity(respBody)); + response.setHeader("Content-Type", "text/xml"); + } catch (Exception e) { + e.printStackTrace(); + } + return response; + } - } - private HttpResponse createResponse(int respStatus, - String respBody) { - HttpResponse response = new BasicHttpResponse( - new BasicStatusLine( - new ProtocolVersion("HTTP", 1, 1), respStatus, "")); - response.setStatusCode(respStatus); - try { - response.setEntity(new StringEntity(respBody)); - response.setHeader("Content-Type", "text/xml"); - } catch (Exception e) { - e.printStackTrace(); - } - return response; - } } |