Package com.rexsl.mock

Examples of com.rexsl.mock.UriInfoMocker


    public void convertsExceptionToResponse() throws Exception {
        final ConstraintsMapper mapper = new ConstraintsMapper();
        final ConstraintViolationException cex =
            Mockito.mock(ConstraintViolationException.class);
        Mockito.doReturn("hello, world!").when(cex).getMessage();
        mapper.setUriInfo(new UriInfoMocker().mock());
        MatcherAssert.assertThat(
            mapper.toResponse(cex).getEntity(),
            Matchers.hasToString(Matchers.containsString("hello"))
        );
    }
View Full Code Here


                @Override
                public String syslog() {
                    return "localhost:12345";
                }
            },
            new UriInfoMocker().mock(),
            new Stats() {
                @Override
                public long bytesTransferred() {
                    //@checkstyle MagicNumber (1 line)
                    return 42L;
View Full Code Here

TOP

Related Classes of com.rexsl.mock.UriInfoMocker

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.