use of com.gw2auth.oauth2.server.repository.account.AccountFederationEntity in project oauth2-server by gw2auth.
the class AccountControllerTest method deleteAccountFederation.
@WithGw2AuthLogin(issuer = "issuer", idAtIssuer = "idAtIssuer")
public void deleteAccountFederation(MockHttpSession session) throws Exception {
final long accountId = AuthenticationHelper.getUser(session).orElseThrow().getAccountId();
this.accountFederationRepository.save(new AccountFederationEntity("issuer2", "idAtIssuer2", accountId));
this.mockMvc.perform(delete("/api/account/federation").session(session).queryParam("issuer", "issuer2").queryParam("idAtIssuer", "idAtIssuer2").with(csrf())).andExpect(status().isOk());
final List<AccountFederationEntity> result = this.accountFederationRepository.findAllByAccountId(accountId);
assertEquals(1, result.size());
assertEquals(new AccountFederationEntity("issuer", "idAtIssuer", accountId), result.get(0));
}
Aggregations