@Override public UnauthorizedException copy() { return new UnauthorizedException(getAddress(), getMessage(), this); } }
@Test(groups = "unit") public void should_create_proper_unauthorized_exception() { UnauthorizedException e = new UnauthorizedException(address1, "You talking to me?"); assertThat(e.getMessage()).isEqualTo("You talking to me?"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); e = (UnauthorizedException) e.copy(); assertThat(e.getMessage()).isEqualTo("You talking to me?"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); }
@Override public DriverException copy() { return new UnauthorizedException(getMessage(), this); } }
@Override public UnauthorizedException copy() { return new UnauthorizedException(getAddress(), getMessage(), this); } }
@Override public UnauthorizedException copy() { return new UnauthorizedException(getAddress(), getMessage(), this); } }
@Override public UnauthorizedException copy() { return new UnauthorizedException(getAddress(), getMessage(), this); } }
private void verifyException(UnauthorizedException e, String user) { assertThat(e.getMessage()) .isEqualTo( String.format( "Either '%s' does not have permission to execute queries as 'alice' " + "or that role does not exist. " + "Run 'GRANT PROXY.EXECUTE ON ROLE 'alice' TO '%s' as an administrator " + "if you wish to allow this.", user, user)); } }
@Test(groups = "unit") public void should_create_proper_unauthorized_exception() { UnauthorizedException e = new UnauthorizedException(address1, "You talking to me?"); assertThat(e.getMessage()).isEqualTo("You talking to me?"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); e = (UnauthorizedException) e.copy(); assertThat(e.getMessage()).isEqualTo("You talking to me?"); assertThat(e.getAddress()).isEqualTo(address1); assertThat(e.getHost()).isEqualTo(address1.getAddress()); }