Remove abstract mongo db test class, because every test starts a mongo.
This class is not necessary Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -49,6 +49,8 @@ import org.springframework.core.env.Environment;
|
||||
import org.springframework.data.auditing.AuditingHandler;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.gridfs.GridFsOperations;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.annotation.DirtiesContext.ClassMode;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
@@ -60,6 +62,8 @@ import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
|
||||
import de.flapdoodle.embed.mongo.MongodExecutable;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@WebAppConfiguration
|
||||
@ActiveProfiles({ "test" })
|
||||
@@ -152,6 +156,12 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware {
|
||||
@Autowired
|
||||
protected TestdataFactory testdataFactory;
|
||||
|
||||
@Autowired
|
||||
protected GridFsOperations operations;
|
||||
|
||||
@Autowired
|
||||
protected MongodExecutable mongodExecutable;
|
||||
|
||||
@Rule
|
||||
public final WithSpringAuthorityRule securityRule = new WithSpringAuthorityRule();
|
||||
|
||||
@@ -190,6 +200,11 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware {
|
||||
testRepositoryManagement.clearTestRepository();
|
||||
}
|
||||
|
||||
@After
|
||||
public void cleanCurrentCollection() {
|
||||
operations.delete(new Query());
|
||||
}
|
||||
|
||||
protected DefaultMockMvcBuilder createMvcWebAppContext() {
|
||||
return MockMvcBuilders.webAppContextSetup(context)
|
||||
.addFilter(new DosFilter(100, 10, "127\\.0\\.0\\.1|\\[0:0:0:0:0:0:0:1\\]", "(^192\\.168\\.)",
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.test.util;
|
||||
|
||||
import org.junit.After;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.data.mongodb.gridfs.GridFsOperations;
|
||||
|
||||
import de.flapdoodle.embed.mongo.MongodExecutable;
|
||||
|
||||
/**
|
||||
* Test class that contains embedded MongoDB for the test.
|
||||
*/
|
||||
public abstract class AbstractIntegrationTestWithMongoDB extends AbstractIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
protected GridFsOperations operations;
|
||||
|
||||
@Autowired
|
||||
protected MongodExecutable mongodExecutable;
|
||||
|
||||
@After
|
||||
public void cleanCurrentCollection() {
|
||||
operations.delete(new Query());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user