Skip to content

Commit

Permalink
[Task 71442] fixed the tests without the additional cleanup required
Browse files Browse the repository at this point in the history
  • Loading branch information
Raf-atmire committed Jun 19, 2020
1 parent de6bc7d commit 891ab3f
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import java.sql.SQLException;
import java.util.Iterator;
import java.util.List;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.dspace.app.rest.model.RegistrationRest;
import org.dspace.app.rest.test.AbstractControllerIntegrationTest;
import org.dspace.eperson.RegistrationData;
import org.dspace.eperson.dao.RegistrationDataDAO;
import org.dspace.services.ConfigurationService;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

Expand All @@ -36,19 +33,6 @@ public class RegistrationRestControllerIT extends AbstractControllerIntegrationT
@Autowired
private ConfigurationService configurationService;


@Before
public void setup() throws SQLException {
CollectionUtils.emptyIfNull(registrationDataDAO.findAll(context, RegistrationData.class)).stream()
.forEach(registrationData -> {
try {
registrationDataDAO.delete(context, registrationData);
} catch (SQLException e) {
throw new RuntimeException(e);
}
});
}

@Test
public void registrationFlowTest() throws Exception {
List<RegistrationData> registrationDataList = registrationDataDAO.findAll(context, RegistrationData.class);
Expand Down Expand Up @@ -119,5 +103,6 @@ public void forgotPasswordTest() throws Exception {
RegistrationData registrationData = iterator.next();
registrationDataDAO.delete(context, registrationData);
}
context.complete();
}
}

0 comments on commit 891ab3f

Please sign in to comment.