@@ -683,12 +683,17 @@ def create_minister_with_attributes(self):
683683 def read_minister (self ):
684684 """Read the Minister entity."""
685685 print ("\n 🟢 Reading Minister entity..." )
686- res = requests .get (f"{ self .base_url } /{ self .MINISTER_ID } " )
686+ payload = {
687+ "id" : self .MINISTER_ID
688+ }
689+ res = requests .post (f"{ self .base_read_url } /search" , json = payload )
687690 print (res .status_code , res .json ())
688691 assert res .status_code in [200 ], f"Failed to read Minister: { res .text } "
689692
690693 # Verify the response data
691694 response_data = res .json ()
695+ response_data = response_data ["body" ][0 ]
696+
692697 print (response_data )
693698 assert response_data ["id" ] == self .MINISTER_ID , (
694699 f"Expected ID { self .MINISTER_ID } , got { response_data ['id' ]} "
@@ -702,9 +707,16 @@ def read_minister(self):
702707 assert response_data ["created" ] == self .START_DATE , (
703708 f"Expected created date { self .START_DATE } , got { response_data ['created' ]} "
704709 )
710+
711+ print ("im here befire you bitchhhhh...." )
712+
705713 # The name value is a protobuf Any that needs to be decoded
706- name_value = response_data ["name" ]["value" ]
707- decoded_name = CoreTestUtils .decode_protobuf_string_value (name_value )
714+ print ("i am here.............." )
715+ name_obj = json .loads (response_data ["name" ])
716+ print (name_obj )
717+ hex_value = name_obj ["value" ]
718+ print (hex_value )
719+ decoded_name = bytes .fromhex (hex_value ).decode ('utf-8' )
708720 assert decoded_name == "Minister of Finance and Economy" , (
709721 f"Expected name 'Minister of Finance and Economy', got { decoded_name } "
710722 )
@@ -850,7 +862,7 @@ def create_minister_with_attributes_with_startDate_and_endDate(self):
850862
851863 print ("\n 🟢 checking Minister with attribute with startDate and endDate..." )
852864
853- url = f"{ self .base_read_url } /v1/entities/ { self .MINISTER_ID } /attributes/{ self .ATTRIBUTE_NAME_2 } "
865+ url = f"{ self .base_read_url } /{ self .MINISTER_ID } /attributes/{ self .ATTRIBUTE_NAME_2 } "
854866 payload = {}
855867
856868 res = requests .post (url , json = payload )
@@ -884,24 +896,23 @@ def create_minister_with_attributes_with_startDate_and_endDate(self):
884896
885897 print ("Decoded value: " , decoded_value )
886898
887- url = f"{ self .base_url } /{ self .MINISTER_ID } "
899+ url = f"{ self .base_read_url } /{ self .MINISTER_ID } /relations"
900+ payload = {}
888901
889- res = requests .get (url )
902+ res = requests .post (url , json = payload )
890903 print (res .status_code , res .json ())
891- assert res .status_code in [200 ], f"Failed to read Minister: { res .text } "
892-
893- response_data = res .json ()
894- print (response_data )
904+ assert res .status_code in [200 ], f"Failed to read Minister relationships: { res .text } "
895905
896- relationships = response_data ["relationships" ]
906+ relationships = res .json ()
907+ print (relationships )
897908
898909 print ("relationships" , relationships )
899910
900911 # check for the start data and the end date
901912 for relationship in relationships :
902- if relationship ["value" ][ " startTime" ] != "" and relationship [ "value" ] ["endTime" ] != "" :
903- assert relationship ["value" ][ " startTime" ] == self .DATA_START_DATE
904- assert relationship ["value" ][ " endTime" ] == self .DATA_END_DATE
913+ if relationship ["startTime" ] != "" and relationship ["endTime" ] != "" :
914+ assert relationship ["startTime" ] == self .DATA_START_DATE
915+ assert relationship ["endTime" ] == self .DATA_END_DATE
905916 else :
906917 pass
907918
@@ -1065,7 +1076,7 @@ def get_base_read_url():
10651076 print ("🟢 Setting up test environment..." )
10661077 read_service_url = os .getenv ("READ_SERVICE_URL" , "http://read:8081" )
10671078 print ("🟢 READ_SERVICE_URL: " , read_service_url )
1068- return read_service_url
1079+ return f" { read_service_url } /v1/entities"
10691080
10701081
10711082# Tabular Attribute Integrity Tests
0 commit comments