use of org.simbasecurity.core.exception.SimbaMessageKey in project simba-os by cegeka.
the class TSimbaErrorMappingHandlerTest method handle_canConvertAllSimbaMessageKeys.
@Test
public void handle_canConvertAllSimbaMessageKeys() {
List<SimbaMessageKey> ignoredSimbaMessageKeys = asList(EMPTY_USERNAME, EMPTY_PASSWORD, WRONG_PASSWORD, EMPTY_TARGET_URL, LOGIN_FAILED, ACCESS_DENIED, EMPTY_SUCCESS_URL, ACCOUNT_BLOCKED, MAIL_ERROR);
Arrays.stream(values()).filter(messageKey -> !ignoredSimbaMessageKeys.contains(messageKey)).forEach(messageKey -> {
assertThatThrownBy(() -> handler.handle(new SimbaException(messageKey, messageKey.name()))).isInstanceOf(TSimbaError.class);
});
}
Aggregations