File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed
main/java/io/pivotal/spring/cloud
test/java/io/pivotal/spring/cloud Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 12
12
/bin /
13
13
.project
14
14
.settings
15
- .classpath
15
+ .classpath
16
+
17
+ out /
Original file line number Diff line number Diff line change 1
1
package io .pivotal .spring .cloud ;
2
2
3
3
import org .springframework .beans .factory .annotation .Value ;
4
+ import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
4
5
import org .springframework .context .annotation .Bean ;
5
6
import org .springframework .context .annotation .Configuration ;
6
7
import org .springframework .security .oauth2 .client .discovery .ProviderConfiguration ;
12
13
import java .net .MalformedURLException ;
13
14
14
15
@ Configuration
16
+ @ ConditionalOnProperty ({"ssoServiceUrl" , "security.oauth2.resource.jwk.key-set-uri" })
15
17
public class IssuerCheckConfiguration {
16
18
@ Value ("${ssoServiceUrl}" )
17
19
private String ssoServiceUrl ;
Original file line number Diff line number Diff line change
1
+ package io .pivotal .spring .cloud ;
2
+
3
+ import org .junit .Rule ;
4
+ import org .junit .Test ;
5
+ import org .junit .rules .ExpectedException ;
6
+ import org .junit .runner .RunWith ;
7
+ import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
8
+ import org .springframework .beans .factory .annotation .Autowired ;
9
+ import org .springframework .boot .test .context .SpringBootTest ;
10
+ import org .springframework .context .ApplicationContext ;
11
+ import org .springframework .security .oauth2 .provider .token .TokenStore ;
12
+ import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
13
+
14
+ @ RunWith (SpringJUnit4ClassRunner .class )
15
+ @ SpringBootTest (classes = IssuerCheckConfiguration .class )
16
+ public class IssuerCheckConfigurationLocalTest {
17
+
18
+ @ Rule
19
+ public ExpectedException thrown = ExpectedException .none ();
20
+
21
+ @ Autowired
22
+ private ApplicationContext applicationContext ;
23
+
24
+ @ Test
25
+ public void testJwkTokenStoreNotFoundInContext () {
26
+ thrown .expect (NoSuchBeanDefinitionException .class );
27
+ thrown .expectMessage ("No qualifying bean of type 'org.springframework.security.oauth2.provider.token.TokenStore' available" );
28
+
29
+ applicationContext .getBean ( TokenStore .class );
30
+
31
+ }
32
+
33
+ }
You can’t perform that action at this time.
0 commit comments