@Test
    void testTensorRankFeatureSetProgrammatically() {
        String tensorString = "{{a:a1, b:b1}:1.0, {a:a2, b:b1}:2.0}";
        Query query = new Query.Builder()
                .setSchemaInfo(createSchemaInfo())
                .setQueryProfile(createQueryProfile()) // Use the instantiation path with query profiles
                .setRequest(HttpRequest.createTestRequest("?" +
                        "&ranking=commonProfile",
                        com.yahoo.jdisc.http.HttpRequest.Method.GET))
                .build();

        query.properties().set("ranking.features.query(myTensor1)", Tensor.from(tensorString));
        assertEquals(Tensor.from(tensorString), query.getRanking().getFeatures().getTensor("query(myTensor1)").get());
    }
Tests queries towards rank profiles using input declarations.

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