Here you can find the source of assertMessageEquals(Throwable ex, String msg)
static void assertMessageEquals(Throwable ex, String msg) throws AssertionError
//package com.java2s; /*// w w w .ja v a2 s. c o m * Copyright 2015-2017 the original author or authors. * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v2.0 which * accompanies this distribution and is available at * * http://www.eclipse.org/legal/epl-v20.html */ public class Main { static void assertMessageEquals(Throwable ex, String msg) throws AssertionError { if (!msg.equals(ex.getMessage())) { throw new AssertionError( "Exception message should be [" + msg + "], but was [" + ex.getMessage() + "]."); } } }