removed outdated test
Co-Authored-By: tomvahl <tomvahl@users.noreply.github.com> Co-Authored-By: Talha Caliskan <killerber4t@users.noreply.github.com> Co-Authored-By: xxnitram <xxnitram@users.noreply.github.com>
This commit is contained in:
@ -97,7 +97,7 @@ public class GroupService {
|
|||||||
public List<Group> findGroupWith(String search) throws EventException {
|
public List<Group> findGroupWith(String search) throws EventException {
|
||||||
List<Group> groups = new ArrayList<>();
|
List<Group> groups = new ArrayList<>();
|
||||||
for (Group group: getAllGroupWithVisibilityPublic()) {
|
for (Group group: getAllGroupWithVisibilityPublic()) {
|
||||||
if (group.getTitle().contains(search)){
|
if (group.getTitle().contains(search)|| group.getDescription().contains(search)){
|
||||||
groups.add(group);
|
groups.add(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,63 +25,6 @@ class SerializationServiceTest {
|
|||||||
void serializeEventTest() throws JsonProcessingException {
|
void serializeEventTest() throws JsonProcessingException {
|
||||||
Event event = new Event(1L,"1");
|
Event event = new Event(1L,"1");
|
||||||
|
|
||||||
assertThat(serializationService.serializeEvent(event)).isEqualTo("{\"type\":\"Event\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\"}");
|
assertThat(serializationService.serializeEvent(event)).isEqualTo("{\"type\":\"Event\",\"group_id\":1,\"user_id\":\"1\"}");
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void deserializeAddUserEventToRightClass() throws JsonProcessingException {
|
|
||||||
String json = "{\"type\":\"AddUserEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\"}";
|
|
||||||
|
|
||||||
Event event = serializationService.deserializeEvent(json);
|
|
||||||
|
|
||||||
assertThat(event).isInstanceOf(AddUserEvent.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void deserializeDeleteUserEventToRightClass() throws JsonProcessingException {
|
|
||||||
String json = "{\"type\":\"DeleteUserEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\"}";
|
|
||||||
|
|
||||||
Event event = serializationService.deserializeEvent(json);
|
|
||||||
|
|
||||||
assertThat(event).isInstanceOf(DeleteUserEvent.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void deserializeUpdateGroupDescriptionEventToRightClass() throws JsonProcessingException {
|
|
||||||
String json = "{\"type\":\"UpdateGroupDescriptionEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\",\"newGroupDescription\":\"test\"}";
|
|
||||||
|
|
||||||
Event event = serializationService.deserializeEvent(json);
|
|
||||||
|
|
||||||
assertThat(event).isInstanceOf(UpdateGroupDescriptionEvent.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void deserializeUpdateGroupTitleEventToRightClass() throws JsonProcessingException {
|
|
||||||
String json = "{\"type\":\"UpdateGroupTitleEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\",\"newGroupTitle\":\"test\"}";
|
|
||||||
|
|
||||||
Event event = serializationService.deserializeEvent(json);
|
|
||||||
|
|
||||||
assertThat(event).isInstanceOf(UpdateGroupTitleEvent.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void deserializeUpdateRoleEventToRightClass() throws JsonProcessingException {
|
|
||||||
System.out.println(serializationService.serializeEvent(new UpdateRoleEvent(1L, "1", Role.ADMIN)));
|
|
||||||
|
|
||||||
String json = "{\"type\":\"UpdateRoleEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":1,\"newRole\":\"ADMIN\"}";
|
|
||||||
|
|
||||||
Event event = serializationService.deserializeEvent(json);
|
|
||||||
|
|
||||||
assertThat(event).isInstanceOf(UpdateRoleEvent.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Disabled
|
|
||||||
@Test
|
|
||||||
void deserializeCreateGroupEventToRightClass() throws JsonProcessingException {
|
|
||||||
String json = "{\"type\":\"CreateGroupEvent\",\"event_id\":1,\"group_id\":1,\"user_id\":\"1\",\"type\":\"test\",\"visibility\":\"test\"}";
|
|
||||||
|
|
||||||
Event event = serializationService.deserializeEvent(json);
|
|
||||||
|
|
||||||
assertThat(event).isInstanceOf(CreateGroupEvent.class);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user