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

View file

@ -963,7 +963,8 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
new SaveExamConfigTableValues(), new SaveExamConfigTableValues(),
new GetConfigurationValues(), new GetConfigurationValues(),
new ActivateExamConfig(), new ActivateExamConfig(),
new DeactivateExamConfig()); new DeactivateExamConfig(),
new GetUserAccountNames());
final Result<ConfigurationNode> newConfigResponse = restService final Result<ConfigurationNode> newConfigResponse = restService
.getBuilder(NewExamConfig.class) .getBuilder(NewExamConfig.class)
@ -971,12 +972,25 @@ public class UseCasesIntegrationTest extends GuiIntegrationTest {
.withFormParam(Domain.CONFIGURATION_NODE.ATTR_DESCRIPTION, "This is a New Exam Config") .withFormParam(Domain.CONFIGURATION_NODE.ATTR_DESCRIPTION, "This is a New Exam Config")
.call(); .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); assertNotNull(newConfigResponse);
assertFalse(newConfigResponse.hasError()); assertFalse(newConfigResponse.hasError());
final ConfigurationNode newConfig = newConfigResponse.get(); final ConfigurationNode newConfig = newConfigResponse.get();
assertEquals("New Exam Config", newConfig.name); assertEquals("New Exam Config", newConfig.name);
assertEquals(Long.valueOf(0), newConfig.templateId); assertEquals(Long.valueOf(0), newConfig.templateId);
assertEquals(userId, newConfig.owner);
} }
} }