EQS Custom Test not working

Hi, I am writing a custom test fo filter out an actor of a particular type. I have added the AIModule and the EQS generator i am using is the generate Actors around Context. The output log gives the following warning :
LogEQS:Warning: Query [FindTargetSoldier] can’t use test [FindAttackingSoldierTest_0] in option 0 [], removing it

The code:

FindTargetSoldier.h
#pragma once

#include "EnvironmentQuery/EnvQueryTest.h"
#include "FindAttackingSoldierTest.generated.h"

/**
 * 
 */
UCLASS()
class CHILDNOMORE_API UFindAttackingSoldierTest : public UEnvQueryTest
{
	GENERATED_BODY()
		UPROPERTY(EditDefaultsOnly, Category = Trace)
		TSubclassOf<UEnvQueryContext> Context;
		virtual void RunTest(FEnvQueryInstance& QueryInstance) const override;
		virtual FText GetDescriptionTitle() const override;
		virtual FText GetDescriptionDetails() const override;

		virtual void PostLoad() override;
};
DECLARE_LOG_CATEGORY_EXTERN(YourLog, Log, All);

FindTargetSoldier.cpp

#include "ChildNoMore.h"
#include "FindAttackingSoldierTest.h"
#include"EngineUtils.h"
#include"SoldierCharacter.h"
#include "Engine.h"
DEFINE_LOG_CATEGORY(YourLog);

void UFindAttackingSoldierTest::RunTest(FEnvQueryInstance& QueryInstance) const
{
	//Now go thrui the queries
	UE_LOG(YourLog, Warning, TEXT("RINNONG TEST"));
	GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::White, FString("TESTING!!!!"));
	float MinThresholdValue = FloatValueMin.GetValue();
	float MaxThresholdValue = FloatValueMax.GetValue();
	TArray<AActor*> ActorsInQuery;
	QueryInstance.GetAllAsActors(ActorsInQuery);
	TArray<FVector> ContextLocations;
	if (!QueryInstance.PrepareContext(Context, ContextLocations))
	{
		GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::White, FString("TESTING!!!!"));
		return;
	}
	for (FEnvQueryInstance::ItemIterator It(this, QueryInstance); It; ++It)
	{
		if (Cast<ASoldierCharacter>(GetItemActor(QueryInstance,*It)))
		{
			It.SetScore(TestPurpose, FilterType, 0.75f, MinThresholdValue, MaxThresholdValue);
		}
		GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::White, FString("TESTING!!!!"));
	}
}

FText UFindAttackingSoldierTest::GetDescriptionTitle() const
{
	return FText::FromString(FString("FIND SOLDIER"));
}
FText UFindAttackingSoldierTest::GetDescriptionDetails() const
{
	return FText::FromString("SOldier test");
}
void UFindAttackingSoldierTest::PostLoad()
{
	Super::PostLoad();
}

UEnvQueryTest* TestOb = SortedTests[TestIndex];
if (TestOb == NULL || !TestOb->IsSupportedItem(GeneratedType))
{
UE_LOG(LogEQS, Warning, TEXT(“Query [%s] can’t use test [%s] in option %d [%s], removing it”),
*GetNameSafe(LocalTemplate), *GetNameSafe(TestOb), OptionIndex, *MyOption->Generator->OptionName);

	SortedTests.RemoveAt(TestIndex, 1, false);
}

Where (for distance example):
GeneratedType = {Class=0x0000000002dd1080 (Name=0x0000000002fa69f0 “EnvQueryItemType_Point”) }

What type of generator you are using?

See in your test:

/** Validation: item type that can be used with this test */
	TSubclassOf<UEnvQueryItemType> ValidItemType;

From distance test:

UEnvQueryTest_Distance::UEnvQueryTest_Distance(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
	.......
	ValidItemType = UEnvQueryItemType_VectorBase::StaticClass();
}

This solved my problem! Just needed to include #include “EnvironmentQuery/Items/EnvQueryItemType_VectorBase.h” at the top of the .cpp file. Thanks

I had to add ValidItemType = UEnvQueryItemType_VectorBase::StaticClass(); in my test’s constructor. The EQS Manager cannot validate type of item for my custom test so it will remove the test from list.