### Question:
TraverseByObjectSearchRequest extends SearchObjectRequest { public TraverseByObjectSearchRequest setQuery(String query) { this.query = query; return this; }  String getQuery(); TraverseByObjectSearchRequest setQuery(String query);  }### Answer:
@Test public void testRequestValidationFailsOnEmpty() { Set<ConstraintViolation<TraverseByObjectSearchRequest>> violations = getValidator().validate(new TraverseByObjectSearchRequest() .setQuery("") ); assertEquals(1, violations.size()); assertPropertyInvalid(violations, "query"); }
@Test public void testRequestValidationFailsOnBlank() { Set<ConstraintViolation<TraverseByObjectSearchRequest>> violations = getValidator().validate(new TraverseByObjectSearchRequest() .setQuery(" ") ); assertEquals(1, violations.size()); assertPropertyInvalid(violations, "query"); }
@Test public void testRequestValidationSucceeds() { assertTrue(getValidator().validate(new TraverseByObjectSearchRequest().setQuery("g.out()")).isEmpty()); }