Asset { public Asset setName(String name) { this.name = name; return this; }  @JsonView({ JsonViewAsset.class, JsonViewPersistence.class }) String getId(); Asset setId(String id); @JsonView({ JsonViewAsset.class, JsonViewPersistence.class }) boolean isExternal(); Asset setExternal(boolean external); @JsonView({ JsonViewPersistence.class, JsonViewAsset.class }) String getName(); Asset setName(String name); @JsonView({ JsonViewPersistence.class, JsonViewAsset.class }) AssetType getType(); Asset setType(AssetType type); @JsonView({ JsonViewAsset.class }) String getComponentId(); Asset setComponentId(String componentId); @JsonView({ JsonViewAsset.class }) String getScope(); Asset setScope(String scope); @JsonView({ JsonViewPersistence.class, JsonViewAsset.class }) int getOrder(); Asset setOrder(int order); @JsonView({ JsonViewAsset.class }) boolean isActive(); Asset setActive(boolean inactive); @Override boolean equals(final Object obj); boolean equalsWithoutComponentId(final Object obj); @Override int hashCode(); @Override String toString(); static Comparator<Asset> getComparatorByOrder(); static Comparator<Asset> getComparatorByComponentId();  }
@Test @Parameters(method = "validNames") public void should_be_valid_when_name_is_valid(String name) { asset.setName(name); beanValidator.validate(asset); }
@Test @Parameters(method = "invalidNames") public void should_be_invalid_when_name_is_invalid(String name, String expectedErrorMessage) { exception.expect(ConstraintValidationException.class); exception.expectMessage(expectedErrorMessage); asset.setName(name); beanValidator.validate(asset); }