junit5: BaseOAuth2ConfigTemplateServiceTest annotation exceptions refactoring
This commit is contained in:
parent
84e4c8f231
commit
1fb9ddc1db
@ -19,6 +19,7 @@ import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.thingsboard.server.common.data.id.TenantId;
|
||||
import org.thingsboard.server.common.data.oauth2.MapperType;
|
||||
@ -51,12 +52,14 @@ public abstract class BaseOAuth2ConfigTemplateServiceTest extends AbstractServic
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = DataValidationException.class)
|
||||
@Test
|
||||
public void testSaveDuplicateProviderId() {
|
||||
OAuth2ClientRegistrationTemplate first = validClientRegistrationTemplate("providerId");
|
||||
OAuth2ClientRegistrationTemplate second = validClientRegistrationTemplate("providerId");
|
||||
oAuth2ConfigTemplateService.saveClientRegistrationTemplate(first);
|
||||
oAuth2ConfigTemplateService.saveClientRegistrationTemplate(second);
|
||||
Assertions.assertThrows(DataValidationException.class, () -> {
|
||||
oAuth2ConfigTemplateService.saveClientRegistrationTemplate(second);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user