Started migration for Boot 1.3 and Security 4.1

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
kaizimmerm
2016-07-07 12:39:40 +02:00
parent eff798393d
commit 04dad8d6de
25 changed files with 146 additions and 703 deletions

View File

@@ -15,10 +15,10 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import org.apache.commons.lang3.RandomStringUtils;
import org.eclipse.hawkbit.exception.SpServerError;
import org.eclipse.hawkbit.repository.model.SoftwareModule;
import org.eclipse.hawkbit.rest.AbstractRestIntegrationTest;
import org.eclipse.hawkbit.rest.AbstractRestIntegrationTestWithMongoDB;
import org.eclipse.hawkbit.rest.json.model.ExceptionInfo;
import org.eclipse.hawkbit.rest.util.MockMvcResultPrinter;
import org.junit.BeforeClass;
import org.junit.After;
import org.junit.Test;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.web.servlet.MvcResult;
@@ -34,23 +34,17 @@ import ru.yandex.qatools.allure.annotations.Stories;
*/
@Features("Component Tests - Management API")
@Stories("Download Resource")
public class SMRessourceMisingMongoDbConnectionTest extends AbstractRestIntegrationTest {
@BeforeClass
public static void initialize() {
// set property to mongoPort which does not start any mongoDB of
// parallel test execution
System.setProperty("spring.data.mongodb.port", "1020");
}
public class SMRessourceMisingMongoDbConnectionTest extends AbstractRestIntegrationTestWithMongoDB {
@Test
@Description("Ensures that the correct error code is returned in case MongoDB unavailable.")
public void missingMongoDbConnectionResultsInErrorAtUpload() throws Exception {
mongodExecutable.stop();
assertThat(softwareManagement.findSoftwareModulesAll(pageReq)).hasSize(0);
assertThat(artifactManagement.countLocalArtifactsAll()).isEqualTo(0);
SoftwareModule sm = entityFactory.generateSoftwareModule(
softwareManagement.findSoftwareModuleTypeByKey("os"), "name 1", "version 1", null, null);
SoftwareModule sm = entityFactory.generateSoftwareModule(softwareManagement.findSoftwareModuleTypeByKey("os"),
"name 1", "version 1", null, null);
sm = softwareManagement.createSoftwareModule(sm);
assertThat(artifactManagement.countLocalArtifactsAll()).isEqualTo(0);
@@ -74,4 +68,9 @@ public class SMRessourceMisingMongoDbConnectionTest extends AbstractRestIntegrat
}
@After
public void cleanCurrentCollection() {
// not needed, mongodb is stopped already
}
}

View File

@@ -29,7 +29,7 @@
<logger name="server-security" level="INFO" />
<Root level="INFO">
<AppenderRef ref="Console" />
<appender-ref ref="CONSOLE" />
</Root>
</configuration>