Skip to content

Instantly share code, notes, and snippets.

@0001vrn
Created April 11, 2020 10:25
Show Gist options
  • Select an option

  • Save 0001vrn/ab44f47fd1b2a8532336ce63c0f88ee3 to your computer and use it in GitHub Desktop.

Select an option

Save 0001vrn/ab44f47fd1b2a8532336ce63c0f88ee3 to your computer and use it in GitHub Desktop.

Revisions

  1. 0001vrn created this gist Apr 11, 2020.
    23 changes: 23 additions & 0 deletions ChgRequestServiceImplTest.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    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);
    }
    }