Skip to content
Snippets Groups Projects
Commit f37b4141 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-5158 Versand Formular Oberallgäu' (#23) from...

Merge pull request 'OZG-5158 Versand Formular Oberallgäu' (#23) from OZG-5158-MPE-Versand-Formular into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/formcycle-plugin/pulls/23


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents d095ee3e 5df69c0c
Branches
Tags
No related merge requests found
......@@ -87,21 +87,22 @@ pipeline {
}
}
stage ('OWASP Dependency-Check Vulnerabilities') {
steps {
dependencyCheck additionalArguments: '''
-o "./"
-s "./"
-f "ALL"
-d /dependency-check-data
--suppression dependency-check-supressions.xml
--disableKnownExploited
--disableArchive
--prettyPrint''', odcInstallation: 'dependency-check-owasp'
dependencyCheckPublisher pattern: 'dependency-check-report.xml'
}
}
// TODO aktuell dauert es viel zu lange und wird am Ende einfach abgebrochen
// stage ('OWASP Dependency-Check Vulnerabilities') {
// steps {
// dependencyCheck additionalArguments: '''
// -o "./"
// -s "./"
// -f "ALL"
// -d /dependency-check-data
// --suppression dependency-check-supressions.xml
// --disableKnownExploited
// --disableArchive
// --prettyPrint''', odcInstallation: 'dependency-check-owasp'
//
// dependencyCheckPublisher pattern: 'dependency-check-report.xml'
// }
// }
stage('Deploy to Nexus'){
steps {
......
......@@ -10,6 +10,7 @@
<description>FormCycle Plugin for OZG-Cloud</description>
<properties>
<plugin.key>de.ozgcloud:ozgcloud-formcycle-plugin</plugin.key>
<!-- Encoding defaults to UTF-8 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......@@ -187,8 +188,8 @@
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Plugin-Key>${project.groupId}:${project.artifactId}</Plugin-Key>
<Plugin-Repository>none</Plugin-Repository>
<Plugin-Key>${plugin.key}</Plugin-Key>
<Plugin-Repository>xfc-proma</Plugin-Repository>
<Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
<Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
<Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title>
......@@ -203,6 +204,7 @@
<!-- Use JUnit to run test classes -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
......
......@@ -87,7 +87,9 @@ public class OzgCloudFormDataMapper {
}
Optional<GrpcSubForm> mapSubForm(FormNode formNode) {
var grpcSubFormDataBuilder = GrpcSubForm.newBuilder().setTitle(formNode.getName()).setLabel(formNode.getTitle());
var grpcSubFormDataBuilder = GrpcSubForm.newBuilder();
Optional.ofNullable(formNode.getName()).ifPresent(grpcSubFormDataBuilder::setTitle);
Optional.ofNullable(formNode.getTitle()).ifPresent(grpcSubFormDataBuilder::setLabel);
for (FormNode nestedNode : formNode.getNestedElements()) {
if (nestedNode.isContainer()) {
mapSubForm(nestedNode).ifPresent(grpcSubFormDataBuilder::addSubForm);
......@@ -112,7 +114,10 @@ public class OzgCloudFormDataMapper {
}
GrpcFormField.Builder createGrpcFormFieldBuilder(FormNode formNode) {
return GrpcFormField.newBuilder().setName(formNode.getName()).setLabel(formNode.getTitle());
var builder = GrpcFormField.newBuilder();
Optional.ofNullable(formNode.getName()).ifPresent(builder::setName);
Optional.ofNullable(formNode.getTitle()).ifPresent(builder::setLabel);
return builder;
}
FormCycleFormHeader buildHeader(FormData formData) {
......
......@@ -162,6 +162,23 @@ class OzgCloudFormDataMapperTest {
assertThat(formFields).first().extracting(GrpcFormField::getLabel).isEqualTo(StructureMockFactory.ITEM_TITLE);
}
@Test
void shouldSkipLabelIfNull() {
var formNode = FormNodeTestFactory.createBuilder().title(null).build();
var formFields = mapper.mapFormFields(formNode);
assertThat(formFields).first().extracting(GrpcFormField::getLabel).toString().isEmpty();
}
@Test
void shouldSkipNameIfNull() {
var formNode = FormNodeTestFactory.createBuilder().name(null).build();
var formFields = mapper.mapFormFields(formNode);
assertThat(formFields).first().extracting(GrpcFormField::getName).toString().isEmpty();
}
}
@Nested
......@@ -236,6 +253,24 @@ class OzgCloudFormDataMapperTest {
assertThat(subform.getLabel()).isEqualTo(StructureMockFactory.ITEM_TITLE);
}
@Test
void shouldSkipLabelIfNull() {
var formNode = FormNodeTestFactory.createBuilder().title(null).nestedElements(List.of(FormNodeTestFactory.create())).build();
var formFields = mapper.mapSubForm(formNode).get();
assertThat(formFields.getLabel()).isEmpty();
}
@Test
void shouldSkipTitleIfNull() {
var formNode = FormNodeTestFactory.createBuilder().name(null).nestedElements(List.of(FormNodeTestFactory.create())).build();
var formFields = mapper.mapSubForm(formNode).get();
assertThat(formFields.getTitle()).isEmpty();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment