class ChgRequestServiceImplTest { private ChgRequestServiceImpl chgRequestService; @Mock private ChgRequestRepository chgRequestRepository; @BeforeEach void setUp() { MockitoAnnotations.initMocks(this); chgRequestService = new ChgRequestServiceImpl(chgRequestRepository); } @Test void shouldCreateChgRequest_thenSaveIt() { var alpha = new AppMetadata("alpha", "1.3.1", "random jira link", "prod-us-west-2", "rolling out new feature"); var id = chgRequestService.createChgRequest(alpha); verify(chgRequestRepository).save(any(ChgRequest.class)); assertNotNull(id); } }