Code review comment: We'd better narrow down the scope of `assertThatThrownBy`.

Code under review:
void testValueStateDefault() throws Throwable {
        final Deadline deadline = Deadline.now().plus(TEST_TIMEOUT);
        final long numElements = 1024L;

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setStateBackend(stateBackend);
        env.setParallelism(maxParallelism);
        
        
        
        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(Integer.MAX_VALUE, 1000L));

        DataStream<Tuple2<Integer, Long>> source =
                env.addSource(new TestAscendingValueSource(numElements));

        ValueStateDescriptor<Tuple2<Integer, Long>> valueState =
                new ValueStateDescriptor<>("any", source.getType(), Tuple2.of(0, 1337L));

        
        QueryableStateStream<Integer, Tuple2<Integer, Long>> queryableState =
                source.keyBy(
                                new KeySelector<Tuple2<Integer, Long>, Integer>() {
                                    private static final long serialVersionUID =
                                            4509274556892655887L;

                                    @Override
                                    public Integer getKey(Tuple2<Integer, Long> value) {
                                        return 1;
                                    }
                                })
                        .asQueryableState("hakuna", valueState);
        assertThatThrownBy(
                        () -> {
                            try (AutoCancellableJob autoCancellableJob =
                                    new AutoCancellableJob(deadline, clusterClient, env)) {

                                final JobID jobId = autoCancellableJob.getJobId();
                                final JobGraph jobGraph = autoCancellableJob.getJobGraph();

                                clusterClient.submitJob(jobGraph).get();

                                
                                int key = 0;
                                CompletableFuture<ValueState<Tuple2<Integer, Long>>> future =
                                        getKvState(
                                                deadline,
                                                client,
                                                jobId,
                                                queryableState.getQueryableStateName(),
                                                key,
                                                BasicTypeInfo.INT_TYPE_INFO,
                                                valueState,
                                                true,
                                                executor);

                                try {
                                    future.get(
                                            deadline.timeLeft().toMillis(), TimeUnit.MILLISECONDS);
                                } catch (ExecutionException | CompletionException e) {
                                    
                                    
                                    throw e.getCause();
                                }
                            }
                        })
                .isInstanceOf(UnknownKeyOrNamespaceException.class);
    }

Line commented on: assertThatThrownBy(

Revised code:
void testValueStateDefault() throws Throwable {
        final Deadline deadline = Deadline.now().plus(TEST_TIMEOUT);
        final long numElements = 1024L;

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setStateBackend(stateBackend);
        env.setParallelism(maxParallelism);
        
        
        
        env.setRestartStrategy(RestartStrategies.fixedDelayRestart(Integer.MAX_VALUE, 1000L));

        DataStream<Tuple2<Integer, Long>> source =
                env.addSource(new TestAscendingValueSource(numElements));

        ValueStateDescriptor<Tuple2<Integer, Long>> valueState =
                new ValueStateDescriptor<>("any", source.getType(), Tuple2.of(0, 1337L));

        
        QueryableStateStream<Integer, Tuple2<Integer, Long>> queryableState =
                source.keyBy(
                                new KeySelector<Tuple2<Integer, Long>, Integer>() {
                                    private static final long serialVersionUID =
                                            4509274556892655887L;

                                    @Override
                                    public Integer getKey(Tuple2<Integer, Long> value) {
                                        return 1;
                                    }
                                })
                        .asQueryableState("hakuna", valueState);

        try (AutoCancellableJob autoCancellableJob =
                new AutoCancellableJob(deadline, clusterClient, env)) {

            final JobID jobId = autoCancellableJob.getJobId();
            final JobGraph jobGraph = autoCancellableJob.getJobGraph();

            clusterClient.submitJob(jobGraph).get();

            
            int key = 0;
            CompletableFuture<ValueState<Tuple2<Integer, Long>>> future =
                    getKvState(
                            deadline,
                            client,
                            jobId,
                            queryableState.getQueryableStateName(),
                            key,
                            BasicTypeInfo.INT_TYPE_INFO,
                            valueState,
                            true,
                            executor);

            assertThatThrownBy(
                            () -> future.get(deadline.timeLeft().toMillis(), TimeUnit.MILLISECONDS))
                    .cause()
                    .isInstanceOf(UnknownKeyOrNamespaceException.class);
        }
    }