Skip to content

Commit d4988d9

Browse files
committed
revert test , will be part of separate pr
1 parent 2945f61 commit d4988d9

File tree

1 file changed

+3
-91
lines changed

1 file changed

+3
-91
lines changed

openmetadata-service/src/test/java/org/openmetadata/service/resources/EntityResourceTest.java

Lines changed: 3 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
import org.junit.jupiter.api.AfterAll;
121121
import org.junit.jupiter.api.Assumptions;
122122
import org.junit.jupiter.api.BeforeAll;
123-
import org.junit.jupiter.api.Order;
124123
import org.junit.jupiter.api.Test;
125124
import org.junit.jupiter.api.TestInfo;
126125
import org.junit.jupiter.api.TestInstance;
@@ -131,7 +130,6 @@
131130
import org.openmetadata.csv.EntityCsvTest;
132131
import org.openmetadata.schema.CreateEntity;
133132
import org.openmetadata.schema.EntityInterface;
134-
import org.openmetadata.schema.api.VoteRequest;
135133
import org.openmetadata.schema.api.data.RestoreEntity;
136134
import org.openmetadata.schema.api.data.TermReference;
137135
import org.openmetadata.schema.api.domains.CreateDataProduct;
@@ -901,36 +899,14 @@ void test_fieldFetchersEfficiency(TestInfo test) throws HttpResponseException {
901899
}
902900

903901
if (fields.contains("followers") && supportsFollowers) {
904-
// Get the actual followers from both bulk and individual loading
905-
List<EntityReference> bulkFollowers = entity.getFollowers();
906-
List<EntityReference> individualFollowers = individualEntity.getFollowers();
907-
908-
// The test should verify that followers are actually fetched and populated
909-
// Previously this might have passed because both were null/empty due to missing field
910-
// support
902+
// Note: followers might be null if no followers exist, which is expected
903+
List<?> bulkFollowers = (List<?>) getField(entity, "followers");
904+
List<?> individualFollowers = (List<?>) getField(individualEntity, "followers");
911905
assertEquals(
912906
listOrEmpty(bulkFollowers).size(),
913907
listOrEmpty(individualFollowers).size(),
914908
"Followers field should be consistently loaded in bulk operations for fields: "
915909
+ fields);
916-
917-
// Add verification that if followers exist, they have proper entity references
918-
if (!listOrEmpty(bulkFollowers).isEmpty()) {
919-
for (EntityReference follower : bulkFollowers) {
920-
assertNotNull(follower.getId(), "Follower should have valid ID");
921-
assertNotNull(follower.getName(), "Follower should have valid name");
922-
assertNotNull(follower.getType(), "Follower should have valid type");
923-
}
924-
}
925-
926-
// Verify that the followers data matches between bulk and individual fetch
927-
if (!listOrEmpty(bulkFollowers).isEmpty()
928-
&& !listOrEmpty(individualFollowers).isEmpty()) {
929-
assertEquals(
930-
bulkFollowers,
931-
individualFollowers,
932-
"Followers data should be identical between bulk and individual loading");
933-
}
934910
}
935911
}
936912

@@ -947,70 +923,6 @@ void test_fieldFetchersEfficiency(TestInfo test) throws HttpResponseException {
947923
}
948924
}
949925

950-
@Test
951-
@Order(5)
952-
@Execution(ExecutionMode.CONCURRENT)
953-
void test_bulkFollowersVotesFetchers(TestInfo test) throws IOException {
954-
// Use a name that always lands first alphabetically.
955-
// Note: The special character "\!A_" is prefixed to ensure the entity sorts before others.
956-
// This allows us to verify ordering without listing all 100 entities.
957-
String alwaysFirstName = "!A_AlwaysFirstEntity";
958-
959-
if (!supportsFieldsQueryParam) {
960-
return;
961-
}
962-
963-
K request = createRequest(alwaysFirstName);
964-
T entity = createEntity(request, ADMIN_AUTH_HEADERS);
965-
966-
// Add a follower if supported.
967-
if (supportsFollowers) {
968-
addFollower(entity.getId(), USER1.getId(), OK, ADMIN_AUTH_HEADERS);
969-
}
970-
971-
// Vote up the entity if supported.
972-
if (supportsVotes) {
973-
VoteRequest voteReq = new VoteRequest().withUpdatedVoteType(VoteRequest.VoteType.VOTED_UP);
974-
WebTarget voteTarget = getResource(entity.getId()).path("vote");
975-
TestUtils.put(voteTarget, voteReq, ChangeEvent.class, OK, ADMIN_AUTH_HEADERS);
976-
}
977-
978-
// Bulk fetch of entities with all allowed fields.
979-
String allFields = getAllowedFields();
980-
Map<String, String> params = new HashMap<>();
981-
params.put("fields", allFields);
982-
ResultList<T> bulk = listEntities(params, ADMIN_AUTH_HEADERS);
983-
984-
// Verify that the created entity is present in the bulk results.
985-
T bulkEntity =
986-
bulk.getData().stream()
987-
.filter(e -> e.getId().equals(entity.getId()))
988-
.findFirst()
989-
.orElse(null);
990-
assertNotNull(bulkEntity);
991-
992-
// Fetch the individual entity to compare details.
993-
T individual = getEntity(entity.getId(), allFields, ADMIN_AUTH_HEADERS);
994-
995-
// Ensure follower counts match for both bulk and individual fetches.
996-
if (supportsFollowers) {
997-
assertNotNull(bulkEntity.getFollowers());
998-
assertEquals(
999-
listOrEmpty(individual.getFollowers()).size(),
1000-
listOrEmpty(bulkEntity.getFollowers()).size());
1001-
}
1002-
1003-
// Ensure vote counts match for bulk and individual fetching.
1004-
if (supportsVotes) {
1005-
assertNotNull(bulkEntity.getVotes());
1006-
assertEquals(individual.getVotes().getUpVotes(), bulkEntity.getVotes().getUpVotes());
1007-
assertEquals(individual.getVotes().getDownVotes(), bulkEntity.getVotes().getDownVotes());
1008-
}
1009-
1010-
// Clean up the created test entity.
1011-
deleteEntity(entity.getId(), ADMIN_AUTH_HEADERS);
1012-
}
1013-
1014926
// Helper method to get field value using reflection
1015927
private Object getField(T entity, String fieldName) {
1016928
try {

0 commit comments

Comments
 (0)