Skip to content

Instantly share code, notes, and snippets.

@0001vrn
Created April 11, 2020 10:25
Show Gist options
  • Save 0001vrn/ab44f47fd1b2a8532336ce63c0f88ee3 to your computer and use it in GitHub Desktop.
Save 0001vrn/ab44f47fd1b2a8532336ce63c0f88ee3 to your computer and use it in GitHub Desktop.
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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment