• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2007 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 package org.mockito.internal.matchers;
6 
7 import java.io.Serializable;
8 
9 import org.mockito.ArgumentMatcher;
10 
11 public class Contains implements ArgumentMatcher<String>, Serializable {
12 
13     private final String substring;
14 
Contains(String substring)15     public Contains(String substring) {
16         this.substring = substring;
17     }
18 
19     @Override
matches(String actual)20     public boolean matches(String actual) {
21         return actual != null && actual.contains(substring);
22     }
23 
24     @Override
toString()25     public String toString() {
26         return "contains(\"" + substring + "\")";
27     }
28 }
29