@Test
public void testBadAgentInstanceSanitization() throws Exception {

    AgentInstance agentInstance = AgentGenerator.agentInstances().getValue().toBuilder()
            .withIpAddress(" 10.0.0.1  ")
            .withHostname(null)
            .build();
    assertThat(sanitizer.sanitize(agentInstance).get().getIpAddress()).isEqualTo("10.0.0.1");
    assertThat(sanitizer.validate(agentInstance)).hasSize(1);
}