Skip to content

Commit

Permalink
Integration tests (#3)
Browse files Browse the repository at this point in the history
* remove client notification by rest

* remove client notification by rest

* add changes to minio connection

* add working version

* add extensions

* remove extensions

* change page names

* modularize

* add cdi events

* add integration tests

* add integration tests
  • Loading branch information
carlosthe19916 committed Apr 25, 2020
1 parent 3ba4b3a commit df75b1c
Show file tree
Hide file tree
Showing 75 changed files with 4,177 additions and 1,088 deletions.
9 changes: 5 additions & 4 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* Copyright 2007-present the original author or authors.
/**
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Eclipse Public License - v 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.eclipse.org/legal/epl-2.0/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
17 changes: 17 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
#
# Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Eclipse Public License - v 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.eclipse.org/legal/epl-2.0/
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# xml-sender project
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fproject-openubl%2Fxml-sender.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fproject-openubl%2Fxml-sender?ref=badge_shield)


This project uses Quarkus, the Supersonic Subatomic Java Framework.

Expand Down Expand Up @@ -31,6 +29,12 @@ You can then execute your native executable with: `./target/xml-sender-1.0.0-SNA

If you want to learn more about building native executables, please consult https://quarkus.io/guides/building-native-image-guide.

## Test Coverage
```shell script
./mvnw package -Pcoverage
./mvnw package -f coverage-report
```

## License

- [Eclipse Public License - v 2.0](./LICENSE)
Expand Down
66 changes: 66 additions & 0 deletions api-core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!--
Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
and other contributors as indicated by the @author tags.
Licensed under the Eclipse Public License - v 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.eclipse.org/legal/epl-2.0/
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.github.project-openubl</groupId>
<artifactId>xml-sender</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>xml-sender-api-core</artifactId>
<name>XML Sender :: API Core</name>

<dependencies>
<!--Quarkus-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-health</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-openapi</artifactId>
</dependency>

<!--Test-->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Eclipse Public License - v 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.eclipse.org/legal/epl-2.0/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.project.openubl.xmlsender.resources;

import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.info.Contact;
import org.eclipse.microprofile.openapi.annotations.info.Info;
import org.eclipse.microprofile.openapi.annotations.info.License;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@OpenAPIDefinition(
info = @Info(
title = "XML Sender API",
version = "1.0.0",
contact = @Contact(
name = "XML Sender API Support",
url = "https://github.com/project-openubl/xml-sender/issues",
email = "projectopenubl+subscribe@googlegroups.com"
),
license = @License(
name = "Eclipse Public License - v 2.0",
url = "https://www.eclipse.org/legal/epl-2.0/"
)
)
)
@ApplicationPath(ApiApplication.API_BASE)
public class ApiApplication extends Application {
public static final String API_BASE = "/api";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Eclipse Public License - v 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.eclipse.org/legal/epl-2.0/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.project.openubl.xmlsender.resources;

import org.jboss.resteasy.api.validation.ResteasyConstraintViolation;
import org.jboss.resteasy.api.validation.ResteasyViolationException;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
import java.util.HashMap;
import java.util.Map;

@Provider
public class ValidationExceptionHandler implements ExceptionMapper<ResteasyViolationException> {
@Override
public Response toResponse(ResteasyViolationException e) {
Map<String, String> violationMessages = new HashMap<>();
for (ResteasyConstraintViolation violation : e.getViolations()) {
String key = violation.getPath();
violationMessages.put(key, "[" + violation.getValue() + "] " + violation.getMessage());
}

return Response.status(400)
.type(MediaType.APPLICATION_JSON)
.entity(violationMessages)
.build();
}
}
Loading

0 comments on commit df75b1c

Please sign in to comment.