use of com.att.aro.core.searching.pojo.SearchingResult in project VideoOptimzer by attdevsupport.
the class PatternSearchingHandlerTest method testResultNotFound.
@Test
public void testResultNotFound() {
SearchingPatternBuilder pattenBuilder = new SearchingPatternBuilder();
pattenBuilder.add("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4},-,3,8,-,7,4", PrivateDataType.regex_phone_number.name());
String text = "https://www.google.com/login/username=fakeName&password=1234&id=423456-7865";
SearchingContent content = new SearchingContent(text);
SearchingResult result = searchingHandler.search(pattenBuilder.build(), content);
assertNotNull(result);
assertEquals(0, result.getWords().size());
}
use of com.att.aro.core.searching.pojo.SearchingResult in project VideoOptimzer by attdevsupport.
the class PatternSearchingHandlerTest method testResultFound.
@Test
public void testResultFound() {
SearchingPatternBuilder pattenBuilder = new SearchingPatternBuilder();
pattenBuilder.add("\\d{3}[-\\.\\s]\\d{3}[-\\.\\s]\\d{4},-,3,8,-,7,4", PrivateDataType.regex_phone_number.name());
String text = "https://www.google.com/login/username=fakeName&password=1234&phone=443-237-7431";
SearchingContent content = new SearchingContent(text);
SearchingResult result = searchingHandler.search(pattenBuilder.build(), content);
assertNotNull(result);
assertEquals(1, result.getWords().size());
assertEquals("443-237-7431", result.getWords().get(0));
}
use of com.att.aro.core.searching.pojo.SearchingResult in project VideoOptimzer by attdevsupport.
the class SearchingStrategyTest method testSinglePatternMatchFound.
@Test
public void testSinglePatternMatchFound() {
SearchingContent content = new SearchingContent("abcabeabd");
SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
patternBuilder.add("abe", PrivateDataType.regex_credit_card_number.name());
SearchingResult result = searchStrategy.applySearch(patternBuilder.build(), content);
assertNotNull(result);
assertEquals(1, result.getWords().size());
assertEquals("abe", result.getWords().get(0));
}
use of com.att.aro.core.searching.pojo.SearchingResult in project VideoOptimzer by attdevsupport.
the class SearchingStrategyTest method testEmptyContent.
@Test
public void testEmptyContent() {
SearchingContent content = new SearchingContent("");
SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
patternBuilder.add("abc", PrivateDataType.regex_credit_card_number.name());
SearchingResult result = searchStrategy.applySearch(patternBuilder.build(), content);
assertNotNull(result);
assertEquals(0, result.getWords().size());
}
use of com.att.aro.core.searching.pojo.SearchingResult in project VideoOptimzer by attdevsupport.
the class SearchingStrategyTest method testSinglePatternMatchNotFound.
@Test
public void testSinglePatternMatchNotFound() {
SearchingContent content = new SearchingContent("abcabeabd");
SearchingPatternBuilder patternBuilder = new SearchingPatternBuilder();
patternBuilder.add("abf", PrivateDataType.regex_credit_card_number.name());
SearchingResult result = searchStrategy.applySearch(patternBuilder.build(), content);
assertNotNull(result);
assertEquals(0, result.getWords().size());
}
Aggregations