Open ingconti opened 2 years ago
We removed the inappropriate cast, following a reevaluation of the creation of the assitant cards. It was used because of inexperience with the json format
pls write here test cases You wrote for JSON
Good morning, after learning how the json syntax works we wrote test cases for other parts of the application related to json The following is one of them, found in the file BrokerTest.java This test uses some custom methods to read the json string
public void deserializeTest(){
InputStream stream = createJSONFile("""
{
"COMMAND" : "CONNECTION_REQUEST",
"NICKNAME" : "gigio"
}""");
try{
broker.receive(stream);
}
catch (IOException e){
//null
}
try {
broker.waitSyncMessage();
} catch (InterruptedException e) {
fail();
}
assertEquals(CommandEnum.fromObjectToEnum(broker.readField(NetworkFieldEnum.COMMAND)), CommandEnum.CONNECTION_REQUEST);
assertEquals((String)broker.readField(NetworkFieldEnum.NICKNAME), "gigio");
broker.flushFirstSyncMessage();
}
I see:
obj = turnOrderList.get(position); turn =(long) obj; obj = stepsList.get(position); steps = (long) obj; why cast?