@@ -62,7 +62,6 @@ func Test_slackResponseService_postEmailList(t *testing.T) {
6262 emails []* model.SlackUserEmail
6363 cid string
6464 ts string
65- userID string
6665 }
6766 tests := []struct {
6867 name string
@@ -76,12 +75,11 @@ func Test_slackResponseService_postEmailList(t *testing.T) {
7675 emails : createEmails (0 , 1 ),
7776 ts : "ts" ,
7877 cid : "cid" ,
79- userID : "sampleUser" ,
8078 },
8179 prepare : func (msr * mock_repository.MockSlackRepository ) {
8280 gomock .InOrder (
83- msr .EXPECT ().PostEphemeral (
84- gomock .Any (), "cid" , createMessage ("参加者一覧" , createEmails (0 , 1 )), "ts" , "sampleUser" ).
81+ msr .EXPECT ().PostMessage (
82+ gomock .Any (), "cid" , createMessage ("参加者一覧" , createEmails (0 , 1 )), "ts" ).
8583 Return (nil ),
8684 )
8785 },
@@ -92,12 +90,11 @@ func Test_slackResponseService_postEmailList(t *testing.T) {
9290 emails : createEmails (0 , lineSizeOfPostEmailList - 1 ),
9391 ts : "ts" ,
9492 cid : "cid" ,
95- userID : "sampleUser" ,
9693 },
9794 prepare : func (msr * mock_repository.MockSlackRepository ) {
9895 gomock .InOrder (
99- msr .EXPECT ().PostEphemeral (
100- gomock .Any (), "cid" , createMessage ("参加者一覧" , createEmails (0 , lineSizeOfPostEmailList - 1 )), "ts" , "sampleUser" ).
96+ msr .EXPECT ().PostMessage (
97+ gomock .Any (), "cid" , createMessage ("参加者一覧" , createEmails (0 , lineSizeOfPostEmailList - 1 )), "ts" ).
10198 Return (nil ),
10299 )
103100 },
@@ -108,15 +105,14 @@ func Test_slackResponseService_postEmailList(t *testing.T) {
108105 emails : createEmails (0 , lineSizeOfPostEmailList ),
109106 ts : "ts" ,
110107 cid : "cid" ,
111- userID : "sampleUser" ,
112108 },
113109 prepare : func (msr * mock_repository.MockSlackRepository ) {
114110 gomock .InOrder (
115- msr .EXPECT ().PostEphemeral (
116- gomock .Any (), "cid" , createMessage ("参加者一覧" , createEmails (0 , lineSizeOfPostEmailList - 1 )), "ts" , "sampleUser" ).
111+ msr .EXPECT ().PostMessage (
112+ gomock .Any (), "cid" , createMessage ("参加者一覧" , createEmails (0 , lineSizeOfPostEmailList - 1 )), "ts" ).
117113 Return (nil ),
118- msr .EXPECT ().PostEphemeral (
119- gomock .Any (), "cid" , createMessage ("" , createEmails (lineSizeOfPostEmailList - 1 , 1 )), "ts" , "sampleUser" ).
114+ msr .EXPECT ().PostMessage (
115+ gomock .Any (), "cid" , createMessage ("" , createEmails (lineSizeOfPostEmailList - 1 , 1 )), "ts" ).
120116 Return (nil ),
121117 )
122118 },
@@ -136,7 +132,7 @@ func Test_slackResponseService_postEmailList(t *testing.T) {
136132 slackRepository : msr ,
137133 errorRepository : mer ,
138134 }
139- if err := s .postEmailList (ctx , tt .args .cid , tt .args .emails , tt .args .ts , tt . args . userID ); (err != nil ) != tt .wantErr {
135+ if err := s .postEmailList (ctx , tt .args .cid , tt .args .emails , tt .args .ts ); (err != nil ) != tt .wantErr {
140136 t .Errorf ("postEmailList() error = %v, wantErr %v" , err , tt .wantErr )
141137 }
142138 })
@@ -160,17 +156,16 @@ func Test_slackErrorResponseService_ReplyEmailList(t *testing.T) {
160156 event : & slackevents.AppMentionEvent {
161157 Channel : "sampleChannel" ,
162158 ThreadTimeStamp : "sampleThreadTimeStamp" ,
163- User : "sampleUser" ,
164159 },
165160 emails : []* model.SlackUserEmail {
166161 {Email : "sample01@example.com" },
167162 {Email : "sample02@example.com" },
168163 },
169164 },
170165 prepare : func (msr * mock_repository.MockSlackRepository ) {
171- msr .EXPECT ().PostEphemeral (gomock .Any (), "sampleChannel" ,
166+ msr .EXPECT ().PostMessage (gomock .Any (), "sampleChannel" ,
172167 "参加者一覧\n sample01@example.com\n sample02@example.com" ,
173- "sampleThreadTimeStamp" , "sampleUser" ).Return (nil )
168+ "sampleThreadTimeStamp" ).Return (nil )
174169 },
175170 },
176171 {
@@ -179,17 +174,16 @@ func Test_slackErrorResponseService_ReplyEmailList(t *testing.T) {
179174 event : & slackevents.AppMentionEvent {
180175 Channel : "sampleChannel" ,
181176 ThreadTimeStamp : "sampleThreadTimeStamp" ,
182- User : "sampleUser" ,
183177 },
184178 emails : []* model.SlackUserEmail {
185179 {Email : "sample01@example.com" },
186180 {Email : "sample02@example.com" },
187181 },
188182 },
189183 prepare : func (msr * mock_repository.MockSlackRepository ) {
190- msr .EXPECT ().PostEphemeral (gomock .Any (), "sampleChannel" ,
184+ msr .EXPECT ().PostMessage (gomock .Any (), "sampleChannel" ,
191185 "参加者一覧\n sample01@example.com\n sample02@example.com" ,
192- "sampleThreadTimeStamp" , "sampleUser" ).Return (errors .New ("sample error" ))
186+ "sampleThreadTimeStamp" ).Return (errors .New ("sample error" ))
193187 },
194188 wantErr : true ,
195189 },
@@ -258,9 +252,9 @@ func Test_slackErrorResponseService_ReplyError(t *testing.T) {
258252 gomock .InOrder (
259253 mer .EXPECT ().ErrThreadNotFound (errors .New ("user_not_found" )).Return (false ),
260254 mer .EXPECT ().ErrUserNotFound (errors .New ("user_not_found" )).Return (true ),
261- msr .EXPECT ().PostEphemeral (gomock .Any (), "sampleChannel" ,
255+ msr .EXPECT ().PostMessage (gomock .Any (), "sampleChannel" ,
262256 "参加者はいないようです:neko_namida:" ,
263- "sampleThreadTimeStamp" , "sampleUser" ).Return (nil ),
257+ "sampleThreadTimeStamp" ).Return (nil ),
264258 )
265259 },
266260 },
@@ -298,9 +292,9 @@ func Test_slackErrorResponseService_ReplyError(t *testing.T) {
298292 gomock .InOrder (
299293 mer .EXPECT ().ErrThreadNotFound (errors .New ("user_not_found" )).Return (false ),
300294 mer .EXPECT ().ErrUserNotFound (errors .New ("user_not_found" )).Return (true ),
301- msr .EXPECT ().PostEphemeral (gomock .Any (), "sampleChannel" ,
295+ msr .EXPECT ().PostMessage (gomock .Any (), "sampleChannel" ,
302296 "参加者はいないようです:neko_namida:" ,
303- "sampleThreadTimeStamp" , "sampleUser" ).Return (errors .New ("sample_error" )),
297+ "sampleThreadTimeStamp" ).Return (errors .New ("sample_error" )),
304298 )
305299 },
306300 wantErr : true ,
0 commit comments