ElasticsearchSituationStore extends AbstractSituationStore implements SituationStore { @Override public void recordSuccessfulResubmit(final String situationId, final String userName) { Situation sit=getSituation(situationId); if (sit != null) { doRecordSuccessfulResubmit(sit, userName); _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 recordResubmit() throws Exception { Situation situation = new Situation(); situation.setId("recordResubmit"); situation.setTimestamp(System.currentTimeMillis()); _elasticsearchSituationStore.store(situation); _elasticsearchSituationStore.recordSuccessfulResubmit(situation.getId(), "recordResubmit"); Situation reload = _elasticsearchSituationStore.getSituation(situation.getId()); assertEquals("recordResubmit", reload.getSituationProperties().get(SituationStore.RESUBMIT_BY_PROPERTY)); assertEquals(SituationStore.RESUBMIT_RESULT_SUCCESS, reload.getSituationProperties().get(SituationStore.RESUBMIT_RESULT_PROPERTY)); assertTrue(reload.getSituationProperties().containsKey(SituationStore.RESUBMIT_AT_PROPERTY)); assertFalse(reload.getSituationProperties().containsKey(SituationStore.RESUBMIT_ERROR_MESSAGE)); }