Skip to content

Commit

Permalink
chore(example): Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
breadrock1 committed Jul 6, 2024
1 parent 60e2d1c commit cb725ce
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions examples/simple/src/test/java/com/example/simple/AppTest.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
package com.example.simple;

import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import com.example.adblock.AdvtBlocker;

/**
* Unit test for simple App.
* Simple test of using library
*/
public class AppTest
{
public class AppTest {
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
public void mainTest() {
List<String> rules = new ArrayList<>(List.of(
"-advertisement-icon.",
"-advertisement-management/",
"-advertisement.",
"-advertisement/script."
));

AdvtBlocker blocker = AdvtBlocker.createInstance(rules);
boolean result = blocker.checkUrls(
"http://example.com/-advertisement-icon.",
"http://example.com/helloworld",
"image"
);

assertTrue(result);
}
}

0 comments on commit cb725ce

Please sign in to comment.