File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
src/test/kotlin/com/katalisindonesia/banyuwangi/controller Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -56,5 +56,51 @@ class AlarmControllerTest(
56
56
}
57
57
}
58
58
59
+ @Test
60
+ fun `list and count empty with parameters` () {
61
+ mockMvc.get(
62
+ " /v1/alarm/list?beginning=2022-01-01" +
63
+ " &ending=2022-01-02&detectionType=TRASH"
64
+ ) {
65
+ headers {
66
+ setBearerAuth(token())
67
+ accept = listOf (MediaType .APPLICATION_JSON )
68
+ }
69
+ }.andExpect {
70
+ status { isOk() }
71
+ content {
72
+ json(
73
+ """ {
74
+ "success": true,
75
+ "message": "ok",
76
+ "data": []
77
+ }""" ,
78
+ strict = false ,
79
+ )
80
+ }
81
+ }
82
+ mockMvc.get(
83
+ " /v1/alarm/count?beginning=2022-01-01" +
84
+ " &ending=2022-01-02&detectionType=TRASH"
85
+ ) {
86
+ headers {
87
+ setBearerAuth(token())
88
+ accept = listOf (MediaType .APPLICATION_JSON )
89
+ }
90
+ }.andExpect {
91
+ status { isOk() }
92
+ content {
93
+ json(
94
+ """ {
95
+ "success": true,
96
+ "message": "ok",
97
+ "data": 0
98
+ }""" ,
99
+ strict = false ,
100
+ )
101
+ }
102
+ }
103
+ }
104
+
59
105
private fun token (): String = tokenManager.accessToken(" banyuwangi-test" , " banyuwangi-test" )
60
106
}
You can’t perform that action at this time.
0 commit comments