public Expectations badAppExpectations ( String errorMessage ) throws Exception { Expectations expectations = new Expectations ( ) ; expectations . addExpectation ( new ResponseStatusExpectation ( HttpServletResponse . SC_UNAUTHORIZED ) ) ; expectations . addExpectation ( new ResponseMessageExpectation ( MpJwtFatConstants . STRING_CONTAINS , errorMessage , "Did not find the error message: " + errorMessage ) ) ; return expectations ; }
Set bad app check expectations - sets checks for a 401 status code and the expected error message in the server s messages . log