@Test public void should_return_disabled_publishers_when_below_agent_limit_disabled_environment() { when(agentDAO.getNumOtherAliveAgents(eq(customerId), eq(jvmUuid), any())).thenReturn(1); when(agentDAO.isEnvironmentEnabled(eq(customerId), eq(jvmUuid))).thenReturn(FALSE); when(agentDAO.getEnvironmentName(eq(jvmUuid))).thenReturn(Optional.of("environment")); val response = agentStateManager.updateAgentState(customerData, jvmUuid, appName, environment); assertThat(response, is(false)); verify(eventService).send(any(AgentPolledEvent.class)); }
@Override @Transactional @SneakyThrows public boolean updateAgentState( CustomerData customerData, String jvmUuid, String appName, String environment) { return doUpdateAgentState(customerData, jvmUuid, appName, environment); }
AgentStateManagerImpl implements AgentStateManager { @Override @Transactional @SneakyThrows public boolean updateAgentState( CustomerData customerData, String jvmUuid, String appName, String environment) { return doUpdateAgentState(customerData, jvmUuid, appName, environment); } }
AgentStateManagerImpl implements AgentStateManager { @Override @Transactional @SneakyThrows public boolean updateAgentState( CustomerData customerData, String jvmUuid, String appName, String environment) { return doUpdateAgentState(customerData, jvmUuid, appName, environment); }  }
AgentStateManagerImpl implements AgentStateManager { @Override @Transactional @SneakyThrows public boolean updateAgentState( CustomerData customerData, String jvmUuid, String appName, String environment) { return doUpdateAgentState(customerData, jvmUuid, appName, environment); }  @Override @Transactional @SneakyThrows boolean updateAgentState(
      CustomerData customerData, String jvmUuid, String appName, String environment); }
AgentStateManagerImpl implements AgentStateManager { @Override @Transactional @SneakyThrows public boolean updateAgentState( CustomerData customerData, String jvmUuid, String appName, String environment) { return doUpdateAgentState(customerData, jvmUuid, appName, environment); }  @Override @Transactional @SneakyThrows boolean updateAgentState(
      CustomerData customerData, String jvmUuid, String appName, String environment);  }