-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49cc333
commit 4eaa4dd
Showing
4 changed files
with
48 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
avni-server-api/src/main/java/org/avni/server/domain/framework/IdHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.avni.server.domain.framework; | ||
|
||
public interface IdHolder { | ||
Long getId(); | ||
String getUuid(); | ||
} |
23 changes: 23 additions & 0 deletions
23
avni-server-api/src/test/java/org/avni/server/domain/CHSBaseEntityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.avni.server.domain; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotEquals; | ||
|
||
public class CHSBaseEntityTest { | ||
@Test | ||
public void equals() { | ||
assertEquals(entity(1l), entity(1l)); | ||
assertNotEquals(entity(1l), entity(2l)); | ||
assertNotEquals(new CHSBaseEntity(), new CHSBaseEntity()); | ||
assertNotEquals(entity(1l), new CHSBaseEntity()); | ||
assertNotEquals(new CHSBaseEntity(), entity(1l)); | ||
} | ||
|
||
private static CHSBaseEntity entity(long id) { | ||
CHSBaseEntity chsBaseEntity = new CHSBaseEntity(); | ||
chsBaseEntity.setId(id); | ||
return chsBaseEntity; | ||
} | ||
} |