@Test
    void testTensorRankFeatureInRequest() {
        String tensorString = "{{a:a1, b:b1}:1.0, {a:a2, b:b1}:2.0}";

        {
            Query query = createTensor1Query(tensorString, "commonProfile", "");
            assertEquals(0, query.errors().size());
            assertEquals(Tensor.from(tensorString), query.properties().get("ranking.features.query(myTensor1)"));
            assertEquals(Tensor.from(tensorString), query.getRanking().getFeatures().getTensor("query(myTensor1)").get());
        }

        { // Partial resolution is sufficient
            Query query = createTensor1Query(tensorString, "bOnly", "");
            assertEquals(0, query.errors().size());
            assertEquals(Tensor.from(tensorString), query.properties().get("ranking.features.query(myTensor1)"));
            assertEquals(Tensor.from(tensorString), query.getRanking().getFeatures().getTensor("query(myTensor1)").get());
        }

        try {
            createTensor1Query(tensorString, "bOnly", "sources=a");
            fail("Expected exception");
        }
        catch (IllegalArgumentException e) {
            assertEquals("Could not set 'ranking.features.query(myTensor1)' to '{{a:a1, b:b1}:1.0, {a:a2, b:b1}:2.0}': No profile named 'bOnly' exists in schemas [a]", Exceptions.toMessageString(e));
        }
    }
Tests queries towards rank profiles using input declarations.

@author bratseth
container-search/src/test/java/com/yahoo/search/query/RankProfileInputTest.java