Package com.s3auth.hosts

Examples of com.s3auth.hosts.ResourceMocker


        final String body = "compressed";
        Mockito.doAnswer(
            new Answer<Resource>() {
                @Override
                public Resource answer(final InvocationOnMock inv) {
                    final Resource answer = new ResourceMocker()
                        .withContent(body).mock();
                    Mockito.doReturn("text/plain")
                        .when(answer).contentType();
                    return answer;
                }
View Full Code Here


    @org.junit.Ignore
    @Test
    public void getsContentOverSSL() throws Exception {
        final Host host = Mockito.mock(Host.class);
        final String body = "secured";
        final Resource answer = new ResourceMocker().withContent(body).mock();
        Mockito.doReturn(answer).when(host).fetch(
            Mockito.any(URI.class),
            Mockito.any(Range.class),
            Mockito.any(Version.class)
        );
View Full Code Here

     * @throws Exception If there is some problem inside
     */
    @Test
    public void closesUnderlyingResource() throws Exception {
        final Host host = Mockito.mock(Host.class);
        final Resource resource = new ResourceMocker().mock();
        Mockito.doReturn(resource).when(host).fetch(
            Mockito.any(URI.class),
            Mockito.any(Range.class),
            Mockito.any(Version.class)
        );
View Full Code Here

TOP

Related Classes of com.s3auth.hosts.ResourceMocker

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.