title: How to use Assert Contains in Groovy
body: <p>Im trying to do some assertion in groovy, and I've found that Java allows you to check if a string contains a certain value, see below:</p>
  
  <pre><code>String longText;
  String uan; 
  
  
  
  Assert.assertThat(longText, CoreMatchers.containsString(uan));
  </code></pre>
  
  <p>Using the following imports:</p>
  
  <pre><code>import static org.junit.Assert.assertThat;
  import static org.hamcrest.CoreMatchers.containsString;
  </code></pre>
  
  <p>Hwoever, groovy doesn't seem to like it and is throwing out error <code>"Missing Property Exception, No such property: Asset for class</code></p>
  
  <p>Does anyone know how I can use assert to check if a string "Contains" a value in Groovy?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Full Code:</p>
  
  <pre><code>def uan = "123"
  
  String fileName = "C:\\Users\\xxx\\Desktop\\checklogs.txt";
  def logs = faker.ivacsLogExtract().getMessages(fileName,uan );
  
  Assert.assertthat(logs, CoreMatchers.containsString(uan));
  </code></pre>