@Test
    void requireThatNormalizerInSecondPhaseIsChecked() throws ParseException {
        try {
            compileSchema("""
                          search test {
                            document test {
                                field title type string {
                                    indexing: index
                                }
                            }
                            rank-profile p2 {
                                function foobar() {
                                    expression: 42 + reciprocal_rank(whatever, 1.0)
                                }
                                function whatever() {
                                    expression: fieldMatch(title)
                                }
                                first-phase {
                                    expression: nativeRank
                                }
                                second-phase {
                                    expression: foobar
                                }
                            }
                          }
                          """);
            fail();
        } catch (IllegalArgumentException e) {
            assertEquals("Rank profile 'p2' is invalid: " +
                         "Cannot use reciprocal_rank(whatever,1.0) from second-phase expression, only valid in global-phase expression",
                         Exceptions.toMessageString(e));
        }
    }
Tests rank profiles with normalizers in bad places

@author arnej
config-model/src/test/java/com/yahoo/schema/NoNormalizersTestCase.java