@Test
    @SuppressWarnings("unchecked")
    public void readResource_AddsSDKUserAgent() throws IOException {
        when(mockConnection.connectToEndpoint(eq(endpoint), any(Map.class), eq("GET"))).thenThrow(new IOException());

        try {
            new DefaultEC2ResourceFetcher(mockConnection).readResource(endpoint);
            fail("Expected an IOexception");
        } catch (Exception exception) {
            Matcher<Map<? extends String, ? extends String>> expectedHeaders = hasEntry("User-Agent", USER_AGENT);
            Mockito.verify(mockConnection, Mockito.times(1)).connectToEndpoint(eq(endpoint), (Map<String, String>) argThat(expectedHeaders), eq("GET"));
        }
    }
When readResource is called,
the SDK User-Agent should be added.
aws-java-sdk-core/src/test/java/com/amazonaws/internal/EC2ResourceFetcherTest.java