Commit cd7a7ce4250ffd6b895cbbb4f9e5dbc982f0494d
1 parent
1f1cc84a
Renamed domainDtos to domainParams
Showing
3 changed files
with
6 additions
and
6 deletions
@@ -26,5 +26,5 @@ import java.util.Set; | @@ -26,5 +26,5 @@ import java.util.Set; | ||
26 | @AllArgsConstructor | 26 | @AllArgsConstructor |
27 | public class OAuth2ClientsParams { | 27 | public class OAuth2ClientsParams { |
28 | private boolean enabled; | 28 | private boolean enabled; |
29 | - private Set<OAuth2ClientsDomainParams> oAuth2DomainDtos; | 29 | + private Set<OAuth2ClientsDomainParams> domainsParams; |
30 | } | 30 | } |
@@ -72,7 +72,7 @@ public class OAuth2ServiceImpl extends AbstractEntityService implements OAuth2Se | @@ -72,7 +72,7 @@ public class OAuth2ServiceImpl extends AbstractEntityService implements OAuth2Se | ||
72 | clientParamsValidator.accept(oauth2Params); | 72 | clientParamsValidator.accept(oauth2Params); |
73 | clientRegistrationDao.deleteAll(); | 73 | clientRegistrationDao.deleteAll(); |
74 | clientRegistrationInfoDao.deleteAll(); | 74 | clientRegistrationInfoDao.deleteAll(); |
75 | - oauth2Params.getOAuth2DomainDtos().forEach(domainParams -> { | 75 | + oauth2Params.getDomainsParams().forEach(domainParams -> { |
76 | domainParams.getClientRegistrations().forEach(clientRegistrationDto -> { | 76 | domainParams.getClientRegistrations().forEach(clientRegistrationDto -> { |
77 | OAuth2ClientRegistrationInfo oAuth2ClientRegistrationInfo = OAuth2Utils.toClientRegistrationInfo(oauth2Params.isEnabled(), clientRegistrationDto); | 77 | OAuth2ClientRegistrationInfo oAuth2ClientRegistrationInfo = OAuth2Utils.toClientRegistrationInfo(oauth2Params.isEnabled(), clientRegistrationDto); |
78 | OAuth2ClientRegistrationInfo savedClientRegistrationInfo = clientRegistrationInfoDao.save(TenantId.SYS_TENANT_ID, oAuth2ClientRegistrationInfo); | 78 | OAuth2ClientRegistrationInfo savedClientRegistrationInfo = clientRegistrationInfoDao.save(TenantId.SYS_TENANT_ID, oAuth2ClientRegistrationInfo); |
@@ -107,10 +107,10 @@ public class OAuth2ServiceImpl extends AbstractEntityService implements OAuth2Se | @@ -107,10 +107,10 @@ public class OAuth2ServiceImpl extends AbstractEntityService implements OAuth2Se | ||
107 | 107 | ||
108 | private final Consumer<OAuth2ClientsParams> clientParamsValidator = oauth2Params -> { | 108 | private final Consumer<OAuth2ClientsParams> clientParamsValidator = oauth2Params -> { |
109 | if (oauth2Params == null | 109 | if (oauth2Params == null |
110 | - || oauth2Params.getOAuth2DomainDtos() == null) { | 110 | + || oauth2Params.getDomainsParams() == null) { |
111 | throw new DataValidationException("Domain params should be specified!"); | 111 | throw new DataValidationException("Domain params should be specified!"); |
112 | } | 112 | } |
113 | - for (OAuth2ClientsDomainParams domainParams : oauth2Params.getOAuth2DomainDtos()) { | 113 | + for (OAuth2ClientsDomainParams domainParams : oauth2Params.getDomainsParams()) { |
114 | if (domainParams.getDomainInfos() == null | 114 | if (domainParams.getDomainInfos() == null |
115 | || domainParams.getDomainInfos().isEmpty()) { | 115 | || domainParams.getDomainInfos().isEmpty()) { |
116 | throw new DataValidationException("List of domain configuration should be specified!"); | 116 | throw new DataValidationException("List of domain configuration should be specified!"); |
@@ -42,7 +42,7 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest { | @@ -42,7 +42,7 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest { | ||
42 | public void after() { | 42 | public void after() { |
43 | oAuth2Service.saveOAuth2Params(EMPTY_PARAMS); | 43 | oAuth2Service.saveOAuth2Params(EMPTY_PARAMS); |
44 | Assert.assertTrue(oAuth2Service.findAllClientRegistrationInfos().isEmpty()); | 44 | Assert.assertTrue(oAuth2Service.findAllClientRegistrationInfos().isEmpty()); |
45 | - Assert.assertTrue(oAuth2Service.findOAuth2Params().getOAuth2DomainDtos().isEmpty()); | 45 | + Assert.assertTrue(oAuth2Service.findOAuth2Params().getDomainsParams().isEmpty()); |
46 | } | 46 | } |
47 | 47 | ||
48 | @Test | 48 | @Test |
@@ -322,7 +322,7 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest { | @@ -322,7 +322,7 @@ public class BaseOAuth2ServiceTest extends AbstractServiceTest { | ||
322 | oAuth2Service.saveOAuth2Params(clientsParams); | 322 | oAuth2Service.saveOAuth2Params(clientsParams); |
323 | List<OAuth2ClientRegistrationInfo> foundClientRegistrationInfos = oAuth2Service.findAllClientRegistrationInfos(); | 323 | List<OAuth2ClientRegistrationInfo> foundClientRegistrationInfos = oAuth2Service.findAllClientRegistrationInfos(); |
324 | Assert.assertEquals(6, foundClientRegistrationInfos.size()); | 324 | Assert.assertEquals(6, foundClientRegistrationInfos.size()); |
325 | - clientsParams.getOAuth2DomainDtos().stream() | 325 | + clientsParams.getDomainsParams().stream() |
326 | .flatMap(domainParams -> domainParams.getClientRegistrations().stream()) | 326 | .flatMap(domainParams -> domainParams.getClientRegistrations().stream()) |
327 | .forEach(clientRegistrationDto -> | 327 | .forEach(clientRegistrationDto -> |
328 | Assert.assertTrue( | 328 | Assert.assertTrue( |