Java Code Examples for com.github.tomakehurst.wiremock.verification.LoggedRequest#getHeader()

The following examples show how to use com.github.tomakehurst.wiremock.verification.LoggedRequest#getHeader() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SdkTransactionIdInHeaderTest.java    From aws-sdk-java-v2 with Apache License 2.0 5 votes vote down vote up
private void assertTransactionIdIsUnchangedAcrossRetries() {
    String previousTransactionId = null;
    for (LoggedRequest request : findAll(getRequestedFor(urlEqualTo(RESOURCE_PATH)))) {
        final String currentTransactionId = request.getHeader(ApplyTransactionIdStage.HEADER_SDK_TRANSACTION_ID);
        // Transaction ID should always be set
        assertNotNull(currentTransactionId);
        // Transaction ID should be the same across retries
        if (previousTransactionId != null) {
            assertEquals(previousTransactionId, currentTransactionId);
        }
        previousTransactionId = currentTransactionId;
    }
}
 
Example 2
Source File: SdkTransactionIdInHeaderTest.java    From ibm-cos-sdk-java with Apache License 2.0 5 votes vote down vote up
private void assertTransactionIdIsUnchangedAcrossRetries() {
    String previousTransactionId = null;
    for (LoggedRequest request : findAll(getRequestedFor(urlEqualTo(RESOURCE_PATH)))) {
        final String currentTransactionId = request.getHeader(HEADER_SDK_TRANSACTION_ID);
        // Transaction ID should always be set
        assertNotNull(currentTransactionId);
        // Transaction ID should be the same across retries
        if (previousTransactionId != null) {
            assertEquals(previousTransactionId, currentTransactionId);
        }
        previousTransactionId = currentTransactionId;
    }
}
 
Example 3
Source File: AbstractHttpClientInstrumentationTest.java    From apm-agent-java with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public String getFirstHeader(String headerName, LoggedRequest loggedRequest) {
    return loggedRequest.getHeader(headerName);
}