Bläddra i källkod

Fix test for checking deleted account policy

tags/v0.10.5
Kristijan Mitrovic 4 år sedan
förälder
incheckning
a3f22a29a3
2 ändrade filer med 8 tillägg och 20 borttagningar
  1. +1
    -11
      bubble-server/src/test/java/bubble/test/system/AccountDeletionTest.java
  2. +7
    -9
      bubble-server/src/test/resources/models/tests/account_deletion/block_delete_account.json

+ 1
- 11
bubble-server/src/test/java/bubble/test/system/AccountDeletionTest.java Visa fil

@@ -29,16 +29,6 @@ public class AccountDeletionTest extends ActivatedBubbleModelTestBase {
}

@Test public void testFullAccountDeletion() throws Exception { modelTest("account_deletion/full_delete_account"); }
@Test public void testBlockAccountDeletion() throws Exception {
modelTest("account_deletion/block_delete_account");

final var accPolicyDAO = getConfiguration().getBean(AccountPolicyDAO.class);
final var policies = accPolicyDAO.findAll();
assertEquals("Not all objects removed for deleted account", 1, policies.size());

final var accDAO = getConfiguration().getBean(AccountDAO.class);
final var acc = accDAO.findById(policies.get(0).getAccount());
assertEquals("The one policy should be for the only existing account", "root", acc.getName());
}
@Test public void testBlockAccountDeletion() throws Exception { modelTest("account_deletion/block_delete_account"); }

}

+ 7
- 9
bubble-server/src/test/resources/models/tests/account_deletion/block_delete_account.json Visa fil

@@ -71,13 +71,11 @@
}
},
"response": { "status": 404 }
}

// {
// "comment": "as root, look up account policy again - it should not be found now",
// "before": "sleep 10s",
// "request": { "session": "rootSession", "uri": "users/{{user.uuid}}/policy" },
// "response": { "status": 404 }
// }
},

]
{
"comment": "as root, look up account policy again - it should recreated for this object with full deletion policy",
"request": { "session": "rootSession", "uri": "users/{{user.uuid}}/policy" },
"response": { "check": [{ "condition": "json.getDeletionPolicy().name() == 'block_delete'" }] }
}
]

Laddar…
Avbryt
Spara