Showing
2 changed files
with
26 additions
and
4 deletions
@@ -28,6 +28,10 @@ import org.hamcrest.Matcher; | @@ -28,6 +28,10 @@ import org.hamcrest.Matcher; | ||
28 | import org.junit.After; | 28 | import org.junit.After; |
29 | import org.junit.Assert; | 29 | import org.junit.Assert; |
30 | import org.junit.Before; | 30 | import org.junit.Before; |
31 | +import org.junit.Rule; | ||
32 | +import org.junit.rules.TestRule; | ||
33 | +import org.junit.rules.TestWatcher; | ||
34 | +import org.junit.runner.Description; | ||
31 | import org.junit.runner.RunWith; | 35 | import org.junit.runner.RunWith; |
32 | import org.springframework.beans.factory.annotation.Autowired; | 36 | import org.springframework.beans.factory.annotation.Autowired; |
33 | import org.springframework.boot.test.context.SpringBootContextLoader; | 37 | import org.springframework.boot.test.context.SpringBootContextLoader; |
@@ -117,6 +121,17 @@ public abstract class AbstractControllerTest { | @@ -117,6 +121,17 @@ public abstract class AbstractControllerTest { | ||
117 | 121 | ||
118 | @Autowired | 122 | @Autowired |
119 | private WebApplicationContext webApplicationContext; | 123 | private WebApplicationContext webApplicationContext; |
124 | + | ||
125 | + @Rule | ||
126 | + public TestRule watcher = new TestWatcher() { | ||
127 | + protected void starting(Description description) { | ||
128 | + log.info("Starting test: {}", description.getMethodName()); | ||
129 | + } | ||
130 | + | ||
131 | + protected void finished(Description description) { | ||
132 | + log.info("Finished test: {}", description.getMethodName()); | ||
133 | + } | ||
134 | + }; | ||
120 | 135 | ||
121 | @Autowired | 136 | @Autowired |
122 | void setConverters(HttpMessageConverter<?>[] converters) { | 137 | void setConverters(HttpMessageConverter<?>[] converters) { |
1 | /** | 1 | /** |
2 | * Copyright © 2016-2017 The Thingsboard Authors | 2 | * Copyright © 2016-2017 The Thingsboard Authors |
3 | - * | 3 | + * <p> |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with 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 | 6 | * You may obtain a copy of the License at |
7 | - * | ||
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | - * | 7 | + * <p> |
8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | + * <p> | ||
10 | * Unless required by applicable law or agreed to in writing, software | 10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
@@ -45,6 +45,13 @@ public class MqttSessionId implements SessionId { | @@ -45,6 +45,13 @@ public class MqttSessionId implements SessionId { | ||
45 | } | 45 | } |
46 | 46 | ||
47 | @Override | 47 | @Override |
48 | + public String toString() { | ||
49 | + return "MqttSessionId{" + | ||
50 | + "id=" + id + | ||
51 | + '}'; | ||
52 | + } | ||
53 | + | ||
54 | + @Override | ||
48 | public int hashCode() { | 55 | public int hashCode() { |
49 | return (int) (id ^ (id >>> 32)); | 56 | return (int) (id ^ (id >>> 32)); |
50 | } | 57 | } |