Commit 0b3748357f5be0d8eb19d6a9b94b423ea80cdaf4

Authored by Andrew Shvayka
1 parent d43995ea

Extra logging for test execution

... ... @@ -28,6 +28,10 @@ import org.hamcrest.Matcher;
28 28 import org.junit.After;
29 29 import org.junit.Assert;
30 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 35 import org.junit.runner.RunWith;
32 36 import org.springframework.beans.factory.annotation.Autowired;
33 37 import org.springframework.boot.test.context.SpringBootContextLoader;
... ... @@ -117,6 +121,17 @@ public abstract class AbstractControllerTest {
117 121
118 122 @Autowired
119 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 136 @Autowired
122 137 void setConverters(HttpMessageConverter<?>[] converters) {
... ...
1 1 /**
2 2 * Copyright © 2016-2017 The Thingsboard Authors
3   - *
  3 + * <p>
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
6 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 10 * Unless required by applicable law or agreed to in writing, software
11 11 * distributed under the License is distributed on an "AS IS" BASIS,
12 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
... ... @@ -45,6 +45,13 @@ public class MqttSessionId implements SessionId {
45 45 }
46 46
47 47 @Override
  48 + public String toString() {
  49 + return "MqttSessionId{" +
  50 + "id=" + id +
  51 + '}';
  52 + }
  53 +
  54 + @Override
48 55 public int hashCode() {
49 56 return (int) (id ^ (id >>> 32));
50 57 }
... ...