use of org.springframework.ws.soap.SoapVersion in project newrelic-java-agent by newrelic.
the class SpringWSUtilsTest method testAddCustomAttributes.
@Test
public void testAddCustomAttributes() {
SoapVersion mockSoapVersion = Mockito.mock(SoapVersion.class);
SoapMessage mockSoapMessage = Mockito.mock(SoapMessage.class);
Mockito.when(mockSoapVersion.getContentType()).thenReturn("application/soap+xml");
Mockito.when(mockSoapVersion.toString()).thenReturn("1.2");
Mockito.when(mockSoapMessage.getSoapAction()).thenReturn("MySoapAction");
Mockito.when(mockSoapMessage.getVersion()).thenReturn(mockSoapVersion);
SpringWSUtils.addCustomAttributes(mockSoapMessage);
Mockito.verify(mockPrivateApi, Mockito.times(1)).addCustomAttribute(SpringWSUtils.PARAM_CATEGORY + "Content", "application/soap+xml");
Mockito.verify(mockPrivateApi, Mockito.times(1)).addCustomAttribute(SpringWSUtils.PARAM_CATEGORY + "SOAP Version", "1.2");
Mockito.verify(mockPrivateApi, Mockito.times(1)).addCustomAttribute(SpringWSUtils.PARAM_CATEGORY + "SOAP Action", "MySoapAction");
}
use of org.springframework.ws.soap.SoapVersion in project newrelic-java-agent by newrelic.
the class SpringWSUtils method addCustomAttributes.
public static void addCustomAttributes(SoapMessage message) {
SoapVersion version = message.getVersion();
String contentType = version.getContentType();
String soapAction = message.getSoapAction();
AgentBridge.privateApi.addCustomAttribute(PARAM_CATEGORY + "SOAP Version", version.toString());
AgentBridge.privateApi.addCustomAttribute(PARAM_CATEGORY + "Content", contentType);
AgentBridge.privateApi.addCustomAttribute(PARAM_CATEGORY + "SOAP Action", soapAction);
}
Aggregations