AgentSanitizerBuilder { public EntitySanitizer build() { return sanitizerBuilder.build(); }  EntitySanitizer build(); static final String AGENT_SANITIZER; }
@Test public void testBadAgentServerGroupSanitization() throws Exception { AgentInstanceGroup agentInstanceGroup = AgentGenerator.agentServerGroups().getValue().toBuilder() .withId(" myId ") .withMin(10) .withDesired(5) .withMax(1) .build(); assertThat(sanitizer.sanitize(agentInstanceGroup).get().getId()).isEqualTo("myId"); assertThat(sanitizer.validate(agentInstanceGroup)).hasSize(2); }
@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); }