Source:
<code>public void shouldNotEnableAgentsWhenInvalidAgentUUIDIsprovided() throws Exception { AgentConfig agentConfig1 = new AgentConfig(UUID.randomUUID().toString(), "remote-host1", "50.40.30.21"); AgentConfig agentConfig2 = new AgentConfig(UUID.randomUUID().toString(), "remote-host2", "50.40.30.22"); agentConfigService.addAgent(agentConfig1, Username.ANONYMOUS); agentConfigService.addAgent(agentConfig2, Username.ANONYMOUS); CruiseConfig cruiseConfig = goConfigDao.load(); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled()); <START> assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled()); <END> HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); ArrayList<String> uuids = new ArrayList<>(); uuids.add(agentConfig1.getUuid()); uuids.add(agentConfig2.getUuid()); uuids.add("invalid-uuid"); agentConfigService.bulkUpdateAgentAttributes(Username.ANONYMOUS, result, uuids, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), TriState.TRUE); cruiseConfig = goConfigDao.load(); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled(), is(false)); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled(), is(false)); assertFalse(result.isSuccessful()); assertThat(result.toString(), result.httpCode(), is(400)); assertTrue(result.toString(), result.toString().contains("AGENTS_WITH_UUIDS_NOT_FOUND")); assertTrue(result.toString(), result.toString().contains("invalid-uuid")); }</code><technical_language>assertion twice, assert agentConfig2</technical_language>

Target:
public void shouldNotEnableAgentsWhenInvalidAgentUUIDIsprovided() throws Exception { AgentConfig agentConfig1 = new AgentConfig(UUID.randomUUID().toString(), "remote-host1", "50.40.30.21"); AgentConfig agentConfig2 = new AgentConfig(UUID.randomUUID().toString(), "remote-host2", "50.40.30.22"); agentConfigService.addAgent(agentConfig1, Username.ANONYMOUS); agentConfigService.addAgent(agentConfig2, Username.ANONYMOUS); CruiseConfig cruiseConfig = goConfigDao.load(); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled()); assertFalse(cruiseConfig.agents().getAgentByUuid(agentConfig2.getUuid()).isDisabled()); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); ArrayList<String> uuids = new ArrayList<>(); uuids.add(agentConfig1.getUuid()); uuids.add(agentConfig2.getUuid()); uuids.add("invalid-uuid"); agentConfigService.bulkUpdateAgentAttributes(Username.ANONYMOUS, result, uuids, new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), new ArrayList<String>(), TriState.TRUE); cruiseConfig = goConfigDao.load(); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig1.getUuid()).isDisabled(), is(false)); assertThat(cruiseConfig.agents().getAgentByUuid(agentConfig2.getUuid()).isDisabled(), is(false)); assertFalse(result.isSuccessful()); assertThat(result.toString(), result.httpCode(), is(400)); assertTrue(result.toString(), result.toString().contains("AGENTS_WITH_UUIDS_NOT_FOUND")); assertTrue(result.toString(), result.toString().contains("invalid-uuid")); }