BaseEntityTest.java 811 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 04 Feb 2025, Andrew Grant of Carrick Software .
  3. * All rights reserved.
  4. */
  5. package scot.carricksoftware.grantswriter;
  6. import org.junit.jupiter.api.BeforeEach;
  7. import org.junit.jupiter.api.Test;
  8. import static org.junit.jupiter.api.Assertions.assertEquals;
  9. import static org.junit.jupiter.api.Assertions.assertNull;
  10. import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
  11. public class BaseEntityTest {
  12. private BaseEntity entity;
  13. @BeforeEach
  14. public void setUp() {
  15. entity = new BaseEntity();
  16. }
  17. @Test
  18. public void getIdTest() {
  19. assertNull(entity.getId());
  20. }
  21. @Test
  22. public void setIdTest() {
  23. Long id = GetRandomLong();
  24. entity.setId(id);
  25. assertEquals(id, entity.getId());
  26. }
  27. }