Commit 40851014 authored by Spiros Koulouzis's avatar Spiros Koulouzis

fixed user schema

parent c354a862
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
*/ */
package nl.uva.sne.drip.api; package nl.uva.sne.drip.api;
import nl.uva.sne.drip.model.User;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
......
package nl.uva.sne.drip.api; package nl.uva.sne.drip.api;
import nl.uva.sne.drip.model.User; import nl.uva.sne.drip.model.
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.slf4j.Logger; import org.slf4j.Logger;
......
...@@ -15,12 +15,12 @@ import java.io.IOException; ...@@ -15,12 +15,12 @@ import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import nl.uva.sne.drip.commons.sure_tosca.client.ApiException;
import nl.uva.sne.drip.commons.utils.ToscaHelper; import nl.uva.sne.drip.commons.utils.ToscaHelper;
import nl.uva.sne.drip.model.CloudsStormSubTopology; import nl.uva.sne.drip.model.CloudsStormSubTopology;
import nl.uva.sne.drip.model.CloudsStormTopTopology; import nl.uva.sne.drip.model.CloudsStormTopTopology;
import nl.uva.sne.drip.model.NodeTemplate; import nl.uva.sne.drip.model.NodeTemplate;
import nl.uva.sne.drip.model.ToscaTemplate; import nl.uva.sne.drip.model.ToscaTemplate;
import nl.uva.sne.drip.sure_tosca.client.ApiException;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
/** /**
......
...@@ -29,9 +29,9 @@ import java.io.IOException; ...@@ -29,9 +29,9 @@ import java.io.IOException;
import java.util.concurrent.TimeoutException; import java.util.concurrent.TimeoutException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import nl.uva.sne.drip.commons.sure_tosca.client.ApiException;
import nl.uva.sne.drip.model.Message; import nl.uva.sne.drip.model.Message;
import nl.uva.sne.drip.model.ToscaTemplate; import nl.uva.sne.drip.model.ToscaTemplate;
import nl.uva.sne.drip.sure_tosca.client.ApiException;
/** /**
* *
...@@ -47,7 +47,7 @@ public class Consumer extends DefaultConsumer { ...@@ -47,7 +47,7 @@ public class Consumer extends DefaultConsumer {
private final ObjectMapper objectMapper; private final ObjectMapper objectMapper;
private final String sureToscaBasePath; private final String sureToscaBasePath;
public Consumer(Channel channel,String sureToscaBasePath) throws IOException, TimeoutException { public Consumer(Channel channel, String sureToscaBasePath) throws IOException, TimeoutException {
super(channel); super(channel);
this.sureToscaBasePath = sureToscaBasePath; this.sureToscaBasePath = sureToscaBasePath;
this.channel = channel; this.channel = channel;
...@@ -73,7 +73,7 @@ public class Consumer extends DefaultConsumer { ...@@ -73,7 +73,7 @@ public class Consumer extends DefaultConsumer {
throw new FileNotFoundException("Could not create input directory: " + tempInputDir.getAbsolutePath()); throw new FileNotFoundException("Could not create input directory: " + tempInputDir.getAbsolutePath());
} }
CloudStormService service = new CloudStormService(sureToscaBasePath,message.getToscaTemplate()); CloudStormService service = new CloudStormService(sureToscaBasePath, message.getToscaTemplate());
ToscaTemplate toscaTemplate = service.execute(); ToscaTemplate toscaTemplate = service.execute();
Message responceMessage = new Message(); Message responceMessage = new Message();
......
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nl.uva.sne.drip.provisioner;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Properties;
import nl.uva.sne.drip.commons.sure_tosca.client.ApiException;
import nl.uva.sne.drip.commons.utils.ToscaHelper;
import nl.uva.sne.drip.model.ToscaTemplate;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author alogo
*/
public class CloudStormServiceTest {
private static ObjectMapper objectMapper;
private static final String testUpdatedApplicationExampleToscaFilePath = ".." + File.separator + "TOSCA" + File.separator + "application_example_2_topologies.yaml";
private static CloudStormService instance;
private static ToscaTemplate toscaTemplate;
public CloudStormServiceTest() {
}
@BeforeClass
public static void setUpClass() throws FileNotFoundException, IOException, JsonProcessingException, ApiException {
Properties prop = new Properties();
String resourceName = "src/test/resources/application.properies";
prop.load(new FileInputStream(resourceName));
byte[] bytes = Files.readAllBytes(Paths.get(testUpdatedApplicationExampleToscaFilePath));
String ymlStr = new String(bytes, "UTF-8");
objectMapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER));
toscaTemplate = objectMapper.readValue(ymlStr, ToscaTemplate.class);
instance = new CloudStormService(prop.getProperty("sure-tosca.base.path"), toscaTemplate);
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of execute method, of class CloudStormService.
*/
@Test
public void testExecute() throws Exception {
System.out.println("execute");
ToscaTemplate expResult = null;
ToscaTemplate result = instance.execute();
}
}
User: User:
type: "object" type: "object"
properties: properties:
id: id:
type: "string" type: "string"
username: username:
type: "string" type: "string"
firstName: firstName:
type: "string" type: "string"
lastName: lastName:
type: "string" type: "string"
email: email:
type: "string" type: "string"
password: password:
type: "string" type: "string"
userStatus: userStatus:
type: "integer" type: "integer"
format: "int32" format: "int32"
description: "User Status" description: "User Status"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment