Hi, gameService.deleteGame Error Game Create Delete the entire code. It should be deleted.
public class GameCreateDeleteTest implements Executor
{
private ServiceAPI sp = new ServiceAPI( Constants.App42ApiKey, Constants.App42ApiSecret);
private final int HTTP_STATUS_SUCCESS = 200;
private String moduleName = "GameCreateDeleteTest";
@Override
public HttpResponseObject execute(HttpRequestObject request) {
JSONObject body = request.getBody();LogService logger = sp.buildLogService();Game game = null;String rankName = "testGame";GameService gameService = sp.buildGameService();
ArrayList<Game> gameList = gameService.getAllGames();
for( int i = 0; i<gameList.size(); i++) {
if( gameList.get(i).name.equals(rankName) ) {
try{
App42Response app42Response = gameService.deleteGame(rankName);
}catch (App42Exception ee) {
logger.debug("App42Exception deleteGame: " + ee.toString(), moduleName);} } }
try{
game = gameService.createGame( rankName, "des: " + rankName ); } catch (App42Exception ee){}
JSONObject jsonResponse = new JSONObject();
try { jsonResponse.put("moduleName", moduleName ); } catch (JSONException e) {}
return new HttpResponseObject(HTTP_STATUS_SUCCESS, jsonResponse);}}