回答編集履歴
1
追記
answer
CHANGED
@@ -90,4 +90,49 @@
|
|
90
90
|
**ライブラリ**
|
91
91
|

|
92
92
|
**順序およびエクスポート**
|
93
|
-

|
93
|
+

|
94
|
+
|
95
|
+
**2019/09/10追記**
|
96
|
+
|
97
|
+
> 直接の原因は
|
98
|
+
assertThat(ac,samePropertyValuesAs(expected));
|
99
|
+
で発生していました。JUnit4:AssertとHamcrestを一緒に使うとダメみたいです。
|
100
|
+
|
101
|
+
『一緒に使うとダメ」とはどのような意味か教えてください。原因とされる下記コードは
|
102
|
+
|
103
|
+
```
|
104
|
+
assertThat(ac,samePropertyValuesAs(expected));
|
105
|
+
```
|
106
|
+
|
107
|
+
実際には下記のコードなので、JUnit4:AssertとHamcrestを一緒に使っていないと思います。
|
108
|
+
|
109
|
+
```
|
110
|
+
org.hamcrest.MatcherAssert.assertThat(ac, org.hamcrest.Matchers.samePropertyValuesAs(expected));
|
111
|
+
```
|
112
|
+
|
113
|
+
これは質問文に記載して頂いたimport文から判断しています。
|
114
|
+
|
115
|
+
```
|
116
|
+
import static org.hamcrest.MatcherAssert.*;
|
117
|
+
import static org.hamcrest.Matchers.*;
|
118
|
+
```
|
119
|
+
|
120
|
+
|
121
|
+
> 別のテストケースで、
|
122
|
+
@RunWith(JUnitPlatform.class)
|
123
|
+
@SelectClasses(ErrorCheckLogicTest.class)
|
124
|
+
を使っているクラスがあり、Eclipseで依存関係に入れるように
|
125
|
+
選択肢が表示されました。これを外すと警告が出ます。
|
126
|
+
|
127
|
+
依存関係に下記`junit-platform-runner`を追加してみてください。
|
128
|
+
|
129
|
+
```
|
130
|
+
<dependency>
|
131
|
+
<groupId>org.junit.platform</groupId>
|
132
|
+
<artifactId>junit-platform-runner</artifactId>
|
133
|
+
<version>1.5.1</version>
|
134
|
+
<scope>test</scope>
|
135
|
+
</dependency>
|
136
|
+
```
|
137
|
+
|
138
|
+
最後に1つ確認させて頂きたいのですが、質問文のAccountTestクラスは、部分的に省略して記載されているのでしょうか?
|