@Test
    void testNativeInStrict() {
        QueryProfileType strictType = new QueryProfileType("strict");
        strictType.setStrict(true);
        QueryProfile strict = new QueryProfile("profile");
        strict.setType(strictType);

        try {
            new Query(HttpRequest.createTestRequest("?hits=10&tracelevel=5", Method.GET), strict.compile(null));
            fail("Above statement should throw");
        } catch (IllegalArgumentException e) {
            // As expected.
        }

        try {
            new Query(HttpRequest.createTestRequest("?notnative=5", Method.GET), strict.compile(null));
            fail("Above statement should throw");
        } catch (IllegalArgumentException e) {
            // As expected.
            assertTrue(Exceptions.toMessageString(e).contains(
                    "Could not set 'notnative' to '5':"
                            + " 'notnative' is not declared in query profile type 'strict', and the type is strict"));
        }
    }
Tests that properties can not be set even if they are native, if declared not settable in the query profile

@author bratseth
container-search/src/test/java/com/yahoo/search/query/profile/types/test/NativePropertiesTestCase.java