Skip to content
Snippets Groups Projects

Added metadatatest

Merged Mads Lundegaard requested to merge testMetadataRepo into dev
1 unresolved thread

I choose to not test getOrCreateMetadata method as this method is not used and should be removed. These repository tests are not thorough as the all use the same abstract class and has few individual methods.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
60 metadataRepository.save(new Metadata());
61 metadataRepository.save(new Metadata());
62
63 List<Metadata> foundMetadata = metadataRepository.findAll();
64 assertEquals(2, foundMetadata.size());
65 }
66
67 /**
68 * Test that save a metadata and finds the metadata by id
69 */
70 @Test
71 void testFindByIdReturnsOptionalWithEntityWithId() {
72 metadataRepository.save(new Metadata());
73 Optional<Metadata> foundMetadata = metadataRepository.findById(INITIAL_ID);
74 assertTrue(foundMetadata.isPresent());
75 assertEquals(INITIAL_ID, foundMetadata.get().getMetadataId());
  • Great work writing this test!

  • mentioned in commit 7e54d855

  • Please register or sign in to reply
    Loading