### Question:
JedisFactory { public void setEndpoint(HostAndPort endpoint) { this.endpoint = endpoint; }  @JsonProperty void setUrl(URI uri); HostAndPort getEndpoint(); void setEndpoint(HostAndPort endpoint); String getHost(); int getPort(); String getPassword(); void setPassword(String password); int getMinIdle(); void setMinIdle(int minIdle); int getMaxIdle(); void setMaxIdle(int maxIdle); int getMaxTotal(); void setMaxTotal(int maxTotal); boolean getSsl(); void setSsl(boolean ssl); int getTimeout(); void setTimeout(int timeout); JedisPool build(Environment environment); static final int DEFAULT_PORT; static final int DEFAULT_MAX_TOTAL; }### Answer:
@Test public void assumesDefaultPortIfNoneGiven() { factory.setEndpoint(HostAndPort.fromString("localhost")); assertThat(factory).hasDefaultRedisPort(); }
@Test public void getsHostAndPortFromEndpoint() { factory.setEndpoint(HostAndPort.fromString("127.0.0.2:11211")); assertThat(factory).hasHost("127.0.0.2"); assertThat(factory).hasPort(11211); }