Package com.proofpoint.http.client.testing

Examples of com.proofpoint.http.client.testing.TestingResponse


        when(inputStream.read()).thenThrow(expectedException);
        when(inputStream.read(any(byte[].class))).thenThrow(expectedException);
        when(inputStream.read(any(byte[].class), anyInt(), anyInt())).thenThrow(expectedException);

        try {
            handler.handle(null, new TestingResponse(OK, contentType(JSON_UTF_8), inputStream));
            fail("expected exception");
        }
        catch (RuntimeException e) {
            assertEquals(e.getMessage(), "Error reading JSON response from server");
            assertSame(e.getCause(), expectedException);
View Full Code Here


    @Test
    public void testAnnounceCacheControl()
            throws Exception
    {
        when(processor.handle(any(Request.class))).thenReturn(
                new TestingResponse(ACCEPTED, ImmutableListMultimap.of("Cache-Control", "max-age=75"), new byte[0]));
        Duration duration = client.announce(announcements).get();

        assertEquals(duration, new Duration(75, TimeUnit.SECONDS));
    }
View Full Code Here

TOP

Related Classes of com.proofpoint.http.client.testing.TestingResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.