Difference between revisions of "Testing"

From DarkWiki
Jump to: navigation, search
(Cypress)
Line 14: Line 14:
 
==Cypress==
 
==Cypress==
  
Front end testing can be automated through Cypress [https://www.cypress.io/].
+
Front end testing can be automated through [https://www.cypress.io/ Cypress].

Revision as of 09:18, 20 February 2018

Mockito

Argument capture

To test to verify a certain value has been passed to a function, you need to use an ArgumentCaptor.

    ...
    ArgumentCaptor<UserRecord> userRecordCapture = ArgumentCaptor.forClass(UserRecord.class);
    Mockito.verify(userRepository).saveUserAccount(userRecordCapture.capture());
    Assert.assertEquals("username", userRecordCapture.getValue().getName());

Cypress

Front end testing can be automated through Cypress.