Describe the bug
If we go by the ordering of the dummy data, we have:
INSERT INTO user_role VALUES (0, 'ADMIN');
INSERT INTO user_role VALUES (0, 'DEV');
INSERT INTO user_role VALUES (0, 'BASIC_USER');
INSERT INTO user_role VALUES (0, 'PREMIUM_USER');
INSERT INTO user_role VALUES (0, 'LOCKED');
Since enums are 0-indexed, at line 22 of Answer4Tests.java:
assertEquals(String.valueOf(Role.class .getEnumConstants()[3]), "BASIC_USER");
we are actually expecting "PREMIUM_USER"
Workaround
Set index value of getEnumConstants()[] to 2
Describe the bug If we go by the ordering of the dummy data, we have:
Since enums are 0-indexed, at line 22 of Answer4Tests.java:
assertEquals(String.valueOf(Role.class .getEnumConstants()[3]), "BASIC_USER");
we are actually expecting "PREMIUM_USER"Workaround Set index value of getEnumConstants()[] to 2