package com.cognifide.aet.executor.model;

import org.junit.Test;

import java.util.Collections;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;

public class TestSuiteRunTest {

  @Test
  public void constructor_whenOverridingNameAndDomain_expectUpdatedValues() {
    TestSuiteRun baseSuiteRun = new TestSuiteRun("abcd", "copmany", "project", "ijkl", Collections.emptyList());

    String newName = "efgh";
    String newDomain = "mnop";
    TestSuiteRun updatedSuiteRun = new TestSuiteRun(baseSuiteRun, newName, newDomain, Collections.emptyList());

    assertThat(updatedSuiteRun.getName(), equalTo(newName));
    assertThat(updatedSuiteRun.getDomain(), equalTo(newDomain));
    assertThat(updatedSuiteRun.getCorrelationId(), containsString(newName));
  }

}
@@ -148,60 +148,8 @@
 at;%0A
-import static org.hamcrest.Matchers.containsString;%0A
 impo
@@ -189,16 +189,16 @@
 qualTo;%0A
+
 %0Apublic 
@@ -309,16 +309,134 @@
 ues() %7B%0A
+    String company = %22company%22;%0A    String project = %22project%22;%0A    String name = %22abcd%22;%0A    String domain = %22ijkl%22;%0A
     Test
@@ -480,44 +480,38 @@
 Run(
-%22abcd%22
+name
 , 
-%22
 co
-p
 m
+p
 any
-%22
 , 
-%22
 project
-%22
 , 
-%22ijkl%22
+domain
 , Co
@@ -702,24 +702,117 @@
 mptyList());
+%0A    String correlationRegex = String.format(%22%5E%25s-%25s-%25s-%5B0-9%5D*$%22, company, project, newName);
 %0A%0A    assert
@@ -982,30 +982,67 @@
 (), 
-containsString(newName
+updatedSuiteRun.getCorrelationId().matches(correlationRegex
 ));%0A

Add correlationId regex assertion