@Test
    void verifyOperation() {
        LocaleContextHolder.setLocale(Locale.getDefault());
        val polator = new SpringAwareMessageMessageInterpolator();
        val source = mock(MessageSource.class);
        when(source.getMessage(anyString(), any(Object[].class), any(Locale.class)))
            .thenThrow(new NoSuchMessageException("code"));
        polator.setMessageSource(source);
        val context = mock(MessageInterpolator.Context.class);
        val descriptor = mock(ConstraintDescriptor.class);
        when(descriptor.getAttributes()).thenReturn(Map.of());
        when(context.getConstraintDescriptor()).thenReturn(descriptor);
        val result = polator.interpolate("code", context);
        assertEquals("code", result);
    }
This is {@link SpringAwareMessageMessageInterpolatorTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-util-api/src/test/java/org/apereo/cas/util/spring/SpringAwareMessageMessageInterpolatorTests.java