Passed
Push — master ( 7072a0...7d8832 )
by Kunal
03:50
created

com.base.Services.ThreadServiceTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
c 4
b 0
f 0
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTeamCreate() 0 12 2
1
package com.base.Services;
2
3
import com.base.AbstractBaseTest;
4
import com.base.Exceptions.BaseHttpException;
5
import com.base.Exceptions.ChannelNotFound;
6
import com.base.Http.Server.Responses.Thread.CreateChannelThreadResponse;
7
import com.base.Models.Thread;
8
import org.junit.Assert;
9
import org.junit.Test;
10
11
public class ThreadServiceTest extends AbstractBaseTest {
12
13
    /**
14
     * Test case for Create Team
15
     *
16
     * @throws BaseHttpException
17
     */
18
    @Test
19
    public void testTeamCreate() {
20
        try {
21
            Thread thread = this.base.threadService().addChannelThread(CreateChannelThreadResponse.VALID_TEAM_SLUG,
22
                    CreateChannelThreadResponse.VALID_CHANNEL_SLUG,
23
                    CreateChannelThreadResponse.VALID_SUBJECT,
24
                    CreateChannelThreadResponse.VALID_DESCRIPTION);
25
            Assert.assertEquals(thread.getSubject(), CreateChannelThreadResponse.VALID_SUBJECT);
26
            Assert.assertEquals(thread.getDescription(), CreateChannelThreadResponse.VALID_DESCRIPTION);
27
            Assert.assertEquals(thread.getId(), CreateChannelThreadResponse.VALID_ID);
28
        } catch (BaseHttpException | ChannelNotFound e) {
29
            Assert.fail(e.getMessage());
30
        }
31
32
    }
33
}
34