AddressType { public String getType() { return type; } AddressType(String type); String getType(); @Override final boolean equals(Object o); @Override final int hashCode(); static final AddressType DNS; static final AddressType RFC_822; static final AddressType UNKNOWN; }
@Test void constructorShouldAcceptValidValue() { String type = "ab"; AddressType addressType = new AddressType(type); assertThat(addressType.getType()) .isEqualTo(type); }
@Test void typeShouldBeTrimmed() { AddressType addressType = new AddressType(" ab "); assertThat(addressType.getType()) .isEqualTo("ab"); }