Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
[#141] bug fix AppUserRepositoryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jenarp committed Jan 26, 2022
1 parent 58caef4 commit 50fe50e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,4 @@ spring:
hibernate:
format_sql: true
dialect: org.hibernate.dialect.H2Dialect

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ void findByExternalId() {
appUser.setExternalId("100");
appUser.setAlias("login");
appUser.setAppUserRole(AppUserRole.USER);
appUser.setId(1L);
appUser.setIdp("github");
appUserRepository.save(appUser);

Expand All @@ -37,7 +36,7 @@ void findByExternalId() {
.hasValueSatisfying(fetched -> {
assertThat(fetched.getExternalId()).isNotNull().isEqualTo(appUser.getExternalId());
assertThat(fetched.getAlias()).isNotNull().isEqualTo(appUser.getAlias());
assertThat(fetched.getId()).isNotNull().isEqualTo(appUser.getId());
assertThat(fetched.getId()).isNotNull();
assertThat(fetched.getIdp()).isNotNull().isEqualTo(appUser.getIdp());
assertThat(fetched.getAppUserRole()).isNotNull().isEqualTo(appUser.getAppUserRole());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.security.oauth2.core.user.OAuth2User;
import org.springframework.security.oauth2.core.user.OAuth2UserAuthority;

Expand All @@ -14,7 +13,6 @@
import java.util.Map;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

@DataJpaTest
Expand All @@ -26,10 +24,8 @@ class Oauth2LoginEventAndListenerTest {
private final String login = "foo";
private final String avatarUrl = "https://www.avatar.com";
private final String externalId = "123";
private final String idp = "github";
private Collection<OAuth2UserAuthority> authorities;
private CustomOAuth2User customOAuth2User;
private ApplicationEventPublisher applicationEventPublisher;
OAuth2LoginEvent oAuth2LoginEvent;
Oauth2LoginEventListener oauth2LoginEventListener;

Expand Down

0 comments on commit 50fe50e

Please sign in to comment.