ElasticsearchSituationStore extends AbstractSituationStore implements SituationStore { public void updateResolutionState(final String situationId, final ResolutionState resolutionState) { Situation sit=getSituation(situationId); if (sit != null) { doUpdateResolutionState(sit, resolutionState); _client.update(situationId, ElasticsearchClient.convertTypeToJson(sit)); } } ElasticsearchSituationStore(); @ServiceInit void init(); List<Situation> getSituations(final SituationsQuery sitQuery); void assignSituation(final String situationId, final String userName); void unassignSituation(final String situationId); void updateResolutionState(final String situationId, final ResolutionState resolutionState); @Override void recordSuccessfulResubmit(final String situationId, final String userName); @Override void recordResubmitFailure(final String situationId, final String errorMessage, final String userName); @ServiceClose void close();  }
@Test public void updateResolutionState() throws Exception { Situation situation = new Situation(); situation.setId("updateResolutionState"); situation.setTimestamp(System.currentTimeMillis()); _elasticsearchSituationStore.store(situation); Situation reload = _elasticsearchSituationStore.getSituation(situation.getId()); assertFalse(reload.getSituationProperties().containsKey(SituationStore.RESOLUTION_STATE_PROPERTY)); _elasticsearchSituationStore.updateResolutionState(situation.getId(),ResolutionState.IN_PROGRESS); reload = _elasticsearchSituationStore.getSituation(situation.getId()); assertEquals(ResolutionState.IN_PROGRESS.name(), reload.getSituationProperties().get(SituationStore.RESOLUTION_STATE_PROPERTY)); }