@Test public void testBlueprintSavingAndLoading() throws ZipException, InvalidGameBlueprintException { // Set up blueprint GameSchema scenario = new GameSchema(); scenario.addAttribute(TEST_ATTRIBUTE_1, TEST_VALUE_1); GameBlueprint savedBlueprint = new GameBlueprint(); savedBlueprint.setMyGameScenario(scenario); // Try to save blueprint DataHandler dataHandler = new DataHandler(); if (!dataHandler.saveBlueprint(savedBlueprint, FILE_PATH + BLUEPRINT_PATH)) fail(); // Load blueprint GameSchema loadedSchema = null; try { GameBlueprint loadedBlueprint = dataHandler.loadBlueprint(FILE_PATH + BLUEPRINT_PATH, false); loadedSchema = loadedBlueprint.getMyGameScenario(); } catch (ClassNotFoundException | IOException e) { fail(); } // Check if the variable values are the same assertTrue(loadedSchema.getAttributesMap().get(TEST_ATTRIBUTE_1).equals(TEST_VALUE_1)); assertFalse( loadedSchema .getAttributesMap() .get(TEST_ATTRIBUTE_1) .equals("THIS SHOULDNT MATCH WITH ANYTHING")); }