### Question:
ClusterV4Request implements JsonEntity { public void setPassword(String password) { this.password = password; }  String getUserName(); void setUserName(String userName); String getPassword(); void setPassword(String password); ExecutorType getExecutorType(); void setExecutorType(ExecutorType executorType); String getName(); void setName(String name); String getDatabaseServerCrn(); void setDatabaseServerCrn(String databaseServerCrn); Set<String> getDatabases(); void setDatabases(Set<String> databases); String getProxyConfigCrn(); void setProxyConfigCrn(String proxyConfigCrn); CloudStorageRequest getCloudStorage(); void setCloudStorage(CloudStorageRequest cloudStorage); ClouderaManagerV4Request getCm(); void setCm(ClouderaManagerV4Request cm); GatewayV4Request getGateway(); void setGateway(GatewayV4Request gateway); String getCustomQueue(); void setCustomQueue(String customQueue); CustomContainerV4Request getCustomContainer(); void setCustomContainer(CustomContainerV4Request customContainer); String getBlueprintName(); void setBlueprintName(String blueprintName); Boolean getValidateBlueprint(); void setValidateBlueprint(Boolean validateBlueprint); boolean isRangerRazEnabled(); void setRangerRazEnabled(boolean rangerRazEnabled);  }### Answer:
@Test public void rejectsInvalidPassword() { underTest.setPassword("x"); Set<ConstraintViolation<ClusterV4Request>> constraintViolations = localValidatorFactory.validate(underTest); assertTrue(isTooShortPassword(constraintViolations)); assertFalse(isMissingLetters(constraintViolations)); assertTrue(isMissingNumbers(constraintViolations)); }
@Test public void rejectsEmptyPassword() { underTest.setPassword(""); Set<ConstraintViolation<ClusterV4Request>> constraintViolations = localValidatorFactory.validate(underTest); assertTrue(isTooShortPassword(constraintViolations)); assertTrue(isMissingLetters(constraintViolations)); assertTrue(isMissingNumbers(constraintViolations)); }
@Test public void rejectsTooShortPassword() { underTest.setPassword("asdf123"); Set<ConstraintViolation<ClusterV4Request>> constraintViolations = localValidatorFactory.validate(underTest); assertTrue(isTooShortPassword(constraintViolations)); assertFalse(isMissingLetters(constraintViolations)); assertFalse(isMissingNumbers(constraintViolations)); }
@Test public void rejectsPasswordWithoutNumber() { underTest.setPassword("asdfasdf"); Set<ConstraintViolation<ClusterV4Request>> constraintViolations = localValidatorFactory.validate(underTest); assertFalse(isTooShortPassword(constraintViolations)); assertFalse(isMissingLetters(constraintViolations)); assertTrue(isMissingNumbers(constraintViolations)); }
@Test public void rejectsPasswordWithoutLetter() { underTest.setPassword("12345678"); Set<ConstraintViolation<ClusterV4Request>> constraintViolations = localValidatorFactory.validate(underTest); assertFalse(isTooShortPassword(constraintViolations)); assertTrue(isMissingLetters(constraintViolations)); assertFalse(isMissingNumbers(constraintViolations)); }
@Test public void acceptsOKPassword() { underTest.setPassword("minimum8"); Set<ConstraintViolation<ClusterV4Request>> constraintViolations = localValidatorFactory.validate(underTest); assertFalse(isTooShortPassword(constraintViolations)); assertFalse(isMissingLetters(constraintViolations)); assertFalse(isMissingNumbers(constraintViolations)); }