You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/01/09 01:14:46 UTC

[GitHub] seanyinx commented on a change in pull request #109: [WIP]SCB-173 mark start of saga

seanyinx commented on a change in pull request #109: [WIP]SCB-173 mark start of saga
URL: https://github.com/apache/incubator-servicecomb-saga/pull/109#discussion_r160297296
 
 

 ##########
 File path: integration-tests/pack-tests/src/test/java/org/apache/servicecomb/saga/integration/pack/tests/PackIT.java
 ##########
 @@ -72,90 +69,92 @@ public void tearDown() throws Exception {
 
   @Test
   public void updatesTxStateToAlpha() throws Exception {
-    HttpHeaders headers = new HttpHeaders();
-
-    headers.set(OmegaContext.GLOBAL_TX_ID_KEY, globalTxId);
-
-    ResponseEntity<String> entity = restTemplate.exchange("/greet?name={name}",
-        GET,
-        new HttpEntity<>(headers),
+    ResponseEntity<String> entity = restTemplate.getForEntity("/greet?name={name}",
         String.class,
         "mike");
 
     assertThat(entity.getStatusCode(), is(OK));
     assertThat(entity.getBody(), is("Greetings, mike; Bonjour, mike"));
 
+    List<String> distinctGlobalTxIds = repository.findDistinctGlobalTxId();
+    assertThat(distinctGlobalTxIds.size(), is(1));
+
+    String globalTxId = distinctGlobalTxIds.get(0);
     List<TxEventEnvelope> envelopes = repository.findByGlobalTxIdOrderByCreationTime(globalTxId);
 
-    assertThat(envelopes.size(), is(4));
-    assertThat(envelopes.get(0).type(), is("TxStartedEvent"));
+    assertThat(envelopes.size(), is(5));
+    assertThat(envelopes.get(0).type(), is("SagaStartedEvent"));
 
 Review comment:
   please rename these `envelopes.get(i)` to sagaStartedEvent, txStartedEvent, etc. it's getting harder to read.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services