summaryrefslogtreecommitdiffstats
path: root/portal-BE/src/main/java
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-08-22 14:04:44 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-08-22 14:04:47 +0200
commit88db33c6a8e2a03e72a0c676f51937418ee84912 (patch)
tree254454cefc443f3521f74299e5d2d61821f29ba5 /portal-BE/src/main/java
parent233bc890b4c79e78ff7c654568ff5b327df7648f (diff)
Postman tests up
Postman tests up Issue-ID: PORTAL-710 Change-Id: I2bdb4ba12b35f7c17014eff2a68fd5534e307bbd Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'portal-BE/src/main/java')
-rw-r--r--portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java4
-rw-r--r--portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java5
-rw-r--r--portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java6
3 files changed, 10 insertions, 5 deletions
diff --git a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java
index c73f7d57..b9e60334 100644
--- a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java
+++ b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java
@@ -83,7 +83,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.permitAll()
.and()
.logout()
- .permitAll();
+ .permitAll()
+ .and()
+ .httpBasic();
http.csrf().disable();
http.headers().frameOptions().disable();
diff --git a/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java b/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
index 2ea4ff24..97fe03da 100644
--- a/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
+++ b/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
@@ -54,6 +54,7 @@ import org.onap.portal.service.fn.FnUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@@ -102,8 +103,8 @@ public class LanguageController {
return new FnLanguage();
}
- @PostMapping(value = "/language")
- public PortalRestResponse<String> saveLanguage(final Principal principal, final FnLanguage fnLanguage){
+ @PostMapping(value = "/language", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
+ public PortalRestResponse<String> saveLanguage(final Principal principal, @RequestBody final FnLanguage fnLanguage){
PortalRestResponse<String> response = new PortalRestResponse<>();
try {
response.setMessage("SUCCESS");
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
index 09cb5a6e..996929e7 100644
--- a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
+++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
@@ -40,6 +40,7 @@
package org.onap.portal.domain.db.fn;
+import com.fasterxml.jackson.annotation.JsonInclude;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -72,6 +73,7 @@ CREATE TABLE `fn_language` (
@Getter
@Setter
@Entity
+@JsonInclude()
@SequenceGenerator(name="seq", initialValue=3, allocationSize=100)
public class FnLanguage {
@@ -82,12 +84,12 @@ public class FnLanguage {
private Long languageId;
@Column(name = "language_name", length = 100, nullable = false)
@Size(max = 100)
- @NotNull
+ @NotNull(message = "languageName must not be null")
@SafeHtml
private String languageName;
@Column(name = "language_alias", length = 100, nullable = false)
@Size(max = 100)
- @NotNull
+ @NotNull(message = "languageAlias must not be null")
@SafeHtml
private String languageAlias;