This commit is contained in:
anhefti 2019-09-11 09:57:55 +02:00
parent 9d6281b7b9
commit 2c063534a4
2 changed files with 26 additions and 6 deletions

14
pom.xml
View file

@ -187,10 +187,10 @@
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>target/jacoco-ut</outputDirectory>
<excludes>
<exclude>ch/ethz/seb/sebserver/gui/content/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/form/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/table/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/widget/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/content/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/form/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/table/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/widget/**/*</exclude>
</excludes>
</configuration>
</execution>
@ -199,6 +199,12 @@
<includes>
<include>ch/ethz/seb/sebserver/*</include>
</includes>
<excludes>
<exclude>ch/ethz/seb/sebserver/gui/content/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/form/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/table/**/*</exclude>
<exclude>ch/ethz/seb/sebserver/gui/widget/**/*</exclude>
</excludes>
<systemPropertyVariables>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>

View file

@ -963,7 +963,8 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
new SaveExamConfigTableValues(),
new GetConfigurationValues(),
new ActivateExamConfig(),
new DeactivateExamConfig());
new DeactivateExamConfig(),
new GetUserAccountNames());
final Result<ConfigurationNode> newConfigResponse = restService
.getBuilder(NewExamConfig.class)
@ -971,12 +972,25 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
.withFormParam(Domain.CONFIGURATION_NODE.ATTR_DESCRIPTION, "This is a New Exam Config")
.call();
// get user id
final String userId = restService
.getBuilder(GetUserAccountNames.class)
.call()
.getOrThrow()
.stream()
.filter(userName -> "examAdmin2".equals(userName.name))
.map(EntityName::getModelId)
.findFirst()
.orElse(null);
assertNotNull(userId);
assertNotNull(newConfigResponse);
assertFalse(newConfigResponse.hasError());
final ConfigurationNode newConfig = newConfigResponse.get();
assertEquals("New Exam Config", newConfig.name);
assertEquals(Long.valueOf(0), newConfig.templateId);
assertEquals(userId, newConfig.owner);
}
}