Skip to content

Commit e82313b

Browse files
committed
Merge branch 'release/0.35'
2 parents 02770da + a1b05e5 commit e82313b

File tree

4 files changed

+65
-4
lines changed

4 files changed

+65
-4
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
0.35

spar-wings-sns-notification/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description "Amazon SNS client wrapper to notify messages to developers or opera
44

55
dependencies {
66
compile "com.amazonaws:aws-java-sdk-sns:$awsJavaSdkVersion"
7+
testCompile "org.springframework:spring-context:$springVersion"
78
compile project(":spar-wings-spring-essential")
89
compile project(":spar-wings-aws-essential")
910
}

spar-wings-sns-notification/src/main/java/jp/xet/sparwings/aws/sns/NotificationService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ private static String toString(Throwable t) {
9292
@Value("#{systemEnvironment['OPS_TOPIC_ARN'] ?: systemProperties['OPS_TOPIC_ARN']}")
9393
String deprecatedOpsTopicArn;
9494

95-
@Value("${sparwings.notification.stack-name}")
95+
@Value("${sparwings.notification.stack-name:#{null}}")
9696
String stackName;
9797

98-
@Value("${sparwings.notification.dev}")
98+
@Value("${sparwings.notification.dev:#{null}}")
9999
String devTopicArn;
100100

101-
@Value("${sparwings.notification.ops}")
101+
@Value("${sparwings.notification.ops:#{null}}")
102102
String opsTopicArn;
103103

104104

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright 2015-2016 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package jp.xet.sparwings.aws.sns;
17+
18+
import static org.mockito.Mockito.mock;
19+
20+
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
21+
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
22+
import org.springframework.context.annotation.Bean;
23+
import org.springframework.context.annotation.Configuration;
24+
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
25+
26+
import org.junit.Test;
27+
28+
import com.amazonaws.services.sns.AmazonSNS;
29+
30+
import jp.xet.sparwings.spring.env.EnvironmentService;
31+
32+
public class NotificationServiceTest {
33+
34+
@Test
35+
public void test() {
36+
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestConfiguration.class);
37+
context.getBean(NotificationService.class);
38+
}
39+
40+
41+
@Configuration
42+
public static class TestConfiguration {
43+
44+
@Bean
45+
public PropertySourcesPlaceholderConfigurer propertysourcePlaceholderConfigurer() {
46+
return new PropertySourcesPlaceholderConfigurer();
47+
}
48+
49+
@Bean
50+
public AutowiredAnnotationBeanPostProcessor postProcessor() {
51+
52+
return new AutowiredAnnotationBeanPostProcessor();
53+
}
54+
55+
@Bean
56+
public NotificationService notificationService() {
57+
return new NotificationService(mock(AmazonSNS.class), "sample-app", mock(EnvironmentService.class));
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)