Skip to content

Commit

Permalink
Add test for site.equals
Browse files Browse the repository at this point in the history
Also remove unused import
  • Loading branch information
alex-yau-ttd committed Nov 9, 2023
1 parent c3d1afb commit 870f83e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import java.io.IOException;
import java.time.Instant;
import java.util.HashSet;
import java.util.List;
Expand Down
23 changes: 23 additions & 0 deletions src/test/java/com/uid2/shared/store/SiteTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.uid2.shared.store;

import com.uid2.shared.model.Site;
import org.junit.jupiter.api.Test;

import java.util.HashSet;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class SiteTest {
@Test
public void testEquals() {
Site a = new Site(1, "1 name", "1 desc", true, new HashSet<>(), new HashSet<>(), true, 0L);
Site b = new Site(1, "1 name", "1 desc", true, new HashSet<>(), new HashSet<>(), true, 0L);
Site c = new Site(1, "1 name", "1 desc", true, new HashSet<>(), new HashSet<>(), null, 0L);

assertTrue(a.equals(b));
assertFalse(a.equals(c));
assertFalse(c.equals(a));
assertTrue(c.equals(c));
}
}

0 comments on commit 870f83e

Please sign in to comment.