Я хочу утверждать фактические результаты, определяя константы в ENUM
. Но когда я строю код, я получаю ошибку инициализации.
public enum EnumTest {
VALUE1("1", "value1"),VALUE2("2", "value2");
private final String value;
private final String desc;
//constructor
private EnumTest (String value, String desc) {
this.value= value;
this.desc= desc;
}
//getter methods
public String getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
Test case
@Test
public void testService() {
ServiceResponse response = service.getConfigurations();
assertNotNull(response);
assert (EnumTest.VALUE1.getValue() == response.getValue());
}
Ниже приведена ошибка, которую я получаю при создании кода
Tests in error:
initializationError(EnumTest)