automatic project update

This commit is contained in:
Julien Dubois 2016-05-13 16:39:55 +02:00
parent 68b263de1b
commit d26e2e99a3
26 changed files with 204 additions and 259 deletions

View File

@ -24,7 +24,7 @@
"en"
],
"serverPort": 8080,
"jhipsterVersion": "3.2.1",
"jhipsterVersion": "3.3.0",
"enableSocialSignIn": false,
"useSass": false,
"jhiPrefix": "jhi"

View File

@ -8,5 +8,13 @@ module.exports = {
port: 9000,
apiPort: 8080,
liveReloadPort: 35729,
uri: 'http://localhost:'
uri: 'http://localhost:',
constantTemplate:
'(function () {\n' +
' \'use strict\';\n' +
' // DO NOT EDIT THIS FILE, EDIT THE GULP TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\n' +
' angular\n' +
' .module(\'<%- moduleName %>\')\n' +
'<% constants.forEach(function(constant) { %> .constant(\'<%- constant.name %>\', <%= constant.value %>)\n<% }) %>;\n' +
'})();\n'
};

View File

@ -1,4 +1,4 @@
// Generated on 2016-05-08 using generator-jhipster 3.2.1
// Generated on 2016-05-13 using generator-jhipster 3.3.0
'use strict';
var gulp = require('gulp'),
@ -175,16 +175,7 @@ gulp.task('ngconstant:dev', function () {
VERSION: util.parseVersion(),
DEBUG_INFO_ENABLED: true
},
wrap:
'(function () {\n' +
'\'use strict\';\n' +
' // DO NOT EDIT THIS FILE, EDIT THE GULP TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\n' +
' <%= __ngModule %>\n' +
'})();\n',
template:
' angular\n' +
' .module(\'<%- moduleName %>\')\n' +
'<% constants.forEach(function(constant) { %> .constant(\'<%- constant.name %>\', <%= constant.value %>)\n<% }) %>;',
template: config.constantTemplate,
stream: true
})
.pipe(rename('app.constants.js'))
@ -198,16 +189,7 @@ gulp.task('ngconstant:prod', function () {
VERSION: util.parseVersion(),
DEBUG_INFO_ENABLED: false
},
wrap:
'(function () {\n' +
'\'use strict\';\n' +
' // DO NOT EDIT THIS FILE, EDIT THE GULP TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE\n' +
' <%= __ngModule %>\n' +
'})();\n',
template:
' angular\n' +
' .module(\'<%- moduleName %>\')\n' +
'<% constants.forEach(function(constant) { %> .constant(\'<%- constant.name %>\', <%= constant.value %>)\n<% }) %>;',
template: config.constantTemplate,
stream: true
})
.pipe(rename('app.constants.js'))

View File

@ -14,7 +14,7 @@
"eslint-config-angular": "0.5.0",
"eslint-plugin-angular": "1.0.1",
"event-stream": "3.3.2",
"generator-jhipster": "3.2.1",
"generator-jhipster": "3.3.0",
"gulp": "3.9.1",
"gulp-angular-filesort": "1.1.1",
"gulp-angular-templatecache": "1.8.0",

19
pom.xml
View File

@ -5,7 +5,7 @@
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.3.4.RELEASE</version>
<version>1.3.5.RELEASE</version>
<relativePath/>
</parent>
@ -15,25 +15,12 @@
<packaging>war</packaging>
<name>sampleApplication</name>
<repositories>
<repository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestones</id>
<url>http://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
<prerequisites>
<maven>3.0.0</maven>
</prerequisites>
<properties>
<hikaricp.version>2.4.3</hikaricp.version>
<hikaricp.version>2.4.6</hikaricp.version>
<assertj-core.version>3.3.0</assertj-core.version>
<awaitility.version>1.7.0</awaitility.version>
<commons-io.version>2.4</commons-io.version>
@ -57,7 +44,7 @@
<metrics-spring.version>3.1.3</metrics-spring.version>
<logstash-logback-encoder.version>4.6</logstash-logback-encoder.version>
<run.addResources>false</run.addResources>
<spring-security.version>4.0.4.RELEASE</spring-security.version>
<spring-security.version>4.1.0.RELEASE</spring-security.version>
<springfox.version>2.4.0</springfox.version>
<!-- Sonar properties -->
<project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>

View File

@ -1,39 +1,20 @@
package com.mycompany.myapp;
import com.mycompany.myapp.config.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
/**
* This is a helper Java class that provides an alternative to creating a web.xml.
* This will be invoked only when the application is deployed to a servlet container like Tomcat, Jboss etc.
*/
public class ApplicationWebXml extends SpringBootServletInitializer {
private final Logger log = LoggerFactory.getLogger(ApplicationWebXml.class);
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.profiles(addDefaultProfile())
.sources(SampleApplicationApp.class);
}
/**
* Set a default profile if it has not been set.
* <p>
* Please use -Dspring.profiles.active=dev
* </p>
*/
private String addDefaultProfile() {
String profile = System.getProperty("spring.profiles.active");
if (profile != null) {
log.info("Running with Spring profile(s) : {}", profile);
return profile;
}
log.warn("No Spring profile configured, running with default configuration");
return Constants.SPRING_PROFILE_DEVELOPMENT;
/**
* set a default to use when no profile is configured.
*/
SampleApplicationApp.addDefaultProfile(application.application());
return application.sources(SampleApplicationApp.class);
}
}

View File

@ -12,7 +12,6 @@ import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.core.env.SimpleCommandLinePropertySource;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
@ -20,6 +19,8 @@ import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@ComponentScan
@EnableAutoConfiguration(exclude = { MetricFilterAutoConfiguration.class, MetricRepositoryAutoConfiguration.class })
@ -41,7 +42,7 @@ public class SampleApplicationApp {
@PostConstruct
public void initApplication() {
if (env.getActiveProfiles().length == 0) {
log.warn("No Spring profile configured, running with default configuration");
log.warn("No Spring profile configured, running with default profile: {}", Constants.SPRING_PROFILE_DEVELOPMENT);
} else {
log.info("Running with Spring profile(s) : {}", Arrays.toString(env.getActiveProfiles()));
Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());
@ -64,8 +65,7 @@ public class SampleApplicationApp {
*/
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(SampleApplicationApp.class);
SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args);
addDefaultProfile(app, source);
addDefaultProfile(app);
Environment env = app.run(args).getEnvironment();
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
@ -79,13 +79,16 @@ public class SampleApplicationApp {
}
/**
* If no profile has been configured, set by default the "dev" profile.
* set a default to use when no profile is configured.
*/
private static void addDefaultProfile(SpringApplication app, SimpleCommandLinePropertySource source) {
if (!source.containsProperty("spring.profiles.active") &&
!System.getenv().containsKey("SPRING_PROFILES_ACTIVE")) {
app.setAdditionalProfiles(Constants.SPRING_PROFILE_DEVELOPMENT);
}
protected static void addDefaultProfile(SpringApplication app) {
Map<String, Object> defProperties = new HashMap<>();
/*
* The default profile to use when no other profiles are defined
* This cannot be set in the `application.yml` file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties.put("spring.profiles.default", Constants.SPRING_PROFILE_DEVELOPMENT);
app.setDefaultProperties(defProperties);
}
}

View File

@ -1,7 +1,6 @@
package com.mycompany.myapp.config;
import com.mycompany.myapp.domain.util.*;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.time.*;

View File

@ -44,7 +44,9 @@ public class WebConfigurer implements ServletContextInitializer, EmbeddedServlet
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
log.info("Web application configuration, using profiles: {}", Arrays.toString(env.getActiveProfiles()));
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profiles: {}", Arrays.toString(env.getActiveProfiles()));
}
EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC);
initMetrics(servletContext, disps);
if (env.acceptsProfiles(Constants.SPRING_PROFILE_PRODUCTION)) {

View File

@ -15,8 +15,8 @@ import java.util.stream.Collectors;
*/
public class UserDTO {
@Pattern(regexp = Constants.LOGIN_REGEX)
@NotNull
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
private String login;

View File

@ -13,10 +13,17 @@
management:
context-path: /management
health:
mail:
enabled: false # When using the MailService, configure an SMTP server and set this to true
spring:
application:
name: sampleApplication
profiles:
# The commented value for `active` can be replaced with valid spring profiles to load.
# This will be overwritten by `--spring.profiles.active` value passed in the commandline or `-Dspring.profiles.active` set in `JAVA_OPTS`
active: #spring.profiles.active#
jpa:
open-in-view: false
hibernate:

View File

@ -10,75 +10,15 @@
function JhiHealthCheckController (JhiHealthService, $uibModal) {
var vm = this;
vm.addHealthObject = addHealthObject;
vm.baseName = baseName;
vm.flattenHealthData = flattenHealthData;
vm.getLabelClass = getLabelClass;
vm.getModuleName = getModuleName;
vm.hasSubSystem = hasSubSystem;
vm.isHealthObject = isHealthObject;
vm.refresh = refresh;
vm.updatingHealth = true;
vm.separator = '.';
vm.getLabelClass = getLabelClass;
vm.refresh = refresh;
vm.showHealth = showHealth;
vm.subSystemName = subSystemName;
vm.transformHealthData = transformHealthData;
vm.baseName = JhiHealthService.getBaseName;
vm.subSystemName = JhiHealthService.getSubSystemName;
vm.refresh();
function addHealthObject (result, isLeaf, healthObject, name) {
var healthData = {
'name': name
};
var details = {};
var hasDetails = false;
angular.forEach(healthObject, function (value, key) {
if (key === 'status' || key === 'error') {
healthData[key] = value;
} else {
if (!vm.isHealthObject(value)) {
details[key] = value;
hasDetails = true;
}
}
});
// Add the of the details
if (hasDetails) {
angular.extend(healthData, { 'details': details});
}
// Only add nodes if they provide additional information
if (isLeaf || hasDetails || healthData.error) {
result.push(healthData);
}
return healthData;
}
function baseName (name) {
if (name) {
var split = name.split('.');
return split[0];
}
}
function flattenHealthData (result, path, data) {
angular.forEach(data, function (value, key) {
if (vm.isHealthObject(value)) {
if (vm.hasSubSystem(value)) {
vm.addHealthObject(result, false, value, vm.getModuleName(path, key));
vm.flattenHealthData(result, vm.getModuleName(path, key), value);
} else {
vm.addHealthObject(result, true, value, vm.getModuleName(path, key));
}
}
});
return result;
}
function getLabelClass (statusState) {
if (statusState === 'UP') {
return 'label-success';
@ -87,47 +27,13 @@
}
}
function getModuleName (path, name) {
var result;
if (path && name) {
result = path + vm.separator + name;
} else if (path) {
result = path;
} else if (name) {
result = name;
} else {
result = '';
}
return result;
}
function hasSubSystem (healthObject) {
var result = false;
angular.forEach(healthObject, function (value) {
if (value && value.status) {
result = true;
}
});
return result;
}
function isHealthObject (healthObject) {
var result = false;
angular.forEach(healthObject, function (value, key) {
if (key === 'status') {
result = true;
}
});
return result;
}
function refresh () {
vm.updatingHealth = true;
JhiHealthService.checkHealth().then(function (response) {
vm.healthData = vm.transformHealthData(response);
vm.healthData = JhiHealthService.transformHealthData(response);
vm.updatingHealth = false;
}, function (response) {
vm.healthData = vm.transformHealthData(response.data);
vm.healthData = JhiHealthService.transformHealthData(response.data);
vm.updatingHealth = false;
});
}
@ -153,19 +59,5 @@
});
}
function subSystemName (name) {
if (name) {
var split = name.split('.');
split.splice(0, 1);
var remainder = split.join('.');
return remainder ? ' - ' + remainder : '';
}
}
function transformHealthData (data) {
var response = [];
vm.flattenHealthData(response, null, data);
return response;
}
}
})();

View File

@ -8,8 +8,12 @@
JhiHealthService.$inject = ['$rootScope', '$http'];
function JhiHealthService ($rootScope, $http) {
var separator = '.';
var service = {
checkHealth: checkHealth
checkHealth: checkHealth,
transformHealthData: transformHealthData,
getBaseName: getBaseName,
getSubSystemName: getSubSystemName
};
return service;
@ -19,5 +23,108 @@
return response.data;
});
}
function transformHealthData (data) {
var response = [];
flattenHealthData(response, null, data);
return response;
}
function getBaseName (name) {
if (name) {
var split = name.split('.');
return split[0];
}
}
function getSubSystemName (name) {
if (name) {
var split = name.split('.');
split.splice(0, 1);
var remainder = split.join('.');
return remainder ? ' - ' + remainder : '';
}
}
/* private methods */
function flattenHealthData (result, path, data) {
angular.forEach(data, function (value, key) {
if (isHealthObject(value)) {
if (hasSubSystem(value)) {
addHealthObject(result, false, value, getModuleName(path, key));
flattenHealthData(result, getModuleName(path, key), value);
} else {
addHealthObject(result, true, value, getModuleName(path, key));
}
}
});
return result;
}
function addHealthObject (result, isLeaf, healthObject, name) {
var healthData = {
'name': name
};
var details = {};
var hasDetails = false;
angular.forEach(healthObject, function (value, key) {
if (key === 'status' || key === 'error') {
healthData[key] = value;
} else {
if (!isHealthObject(value)) {
details[key] = value;
hasDetails = true;
}
}
});
// Add the of the details
if (hasDetails) {
angular.extend(healthData, { 'details': details});
}
// Only add nodes if they provide additional information
if (isLeaf || hasDetails || healthData.error) {
result.push(healthData);
}
return healthData;
}
function getModuleName (path, name) {
var result;
if (path && name) {
result = path + separator + name;
} else if (path) {
result = path;
} else if (name) {
result = name;
} else {
result = '';
}
return result;
}
function hasSubSystem (healthObject) {
var result = false;
angular.forEach(healthObject, function (value) {
if (value && value.status) {
result = true;
}
});
return result;
}
function isHealthObject (healthObject) {
var result = false;
angular.forEach(healthObject, function (value, key) {
if (key === 'status') {
result = true;
}
});
return result;
}
}
})();

View File

@ -17,7 +17,7 @@
<div class="form-group">
<label class="control-label" translate="userManagement.login">Login</label>
<input type="text" class="form-control" name="login"
ng-model="vm.user.login" ng-required="vm.user.id == null" ng-maxlength="50">
ng-model="vm.user.login" ng-required="vm.user.id == null" ng-minlength=1 ng-maxlength=50 ng-pattern="/^[_'.@A-Za-z0-9-]*$/">
<div ng-show="editForm.login.$invalid">
<p class="help-block"

View File

@ -31,7 +31,7 @@
<td>{{user.email}}</td>
<td>
<span class="label label-danger" ng-click="vm.setActive(user, true)" ng-show="!user.activated"
translate="userManagement.deactivated" style="cursor: pointer;">Desactivated</span>
translate="userManagement.deactivated" style="cursor: pointer;">Deactivated</span>
<span class="label label-success" ng-click="vm.setActive(user, false)" ng-show="user.activated"
translate="userManagement.activated" style="cursor: pointer;">Activated</span>
</td>

View File

@ -1,7 +1,7 @@
(function () {
'use strict';
'use strict';
// DO NOT EDIT THIS FILE, EDIT THE GULP TASK NGCONSTANT SETTINGS INSTEAD WHICH GENERATES THIS FILE
angular
angular
.module('sampleApplicationApp')
.constant('VERSION', "0.0.1-SNAPSHOT")
.constant('DEBUG_INFO_ENABLED', true)

View File

@ -9,7 +9,7 @@
'</div>',
controller: jhiAlertErrorController
};
angular
.module('sampleApplicationApp')
.component('jhiAlertError', jhiAlertError);
@ -68,6 +68,10 @@
}
break;
case 404:
addErrorAlert('Not found','error.url.not.found');
break;
default:
if (httpResponse.data && httpResponse.data.message) {
addErrorAlert(httpResponse.data.message);

View File

@ -2,6 +2,7 @@
<div>
<h2><span translate="sampleApplicationApp.bankAccount.detail.title">Bank Account</span> {{vm.bankAccount.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="dl-horizontal jh-entity-details">
<dt><span translate="sampleApplicationApp.bankAccount.name">Name</span></dt>
<dd>

View File

@ -14,7 +14,9 @@
'get': {
method: 'GET',
transformResponse: function (data) {
data = angular.fromJson(data);
if (data) {
data = angular.fromJson(data);
}
return data;
}
},

View File

@ -2,6 +2,7 @@
<div>
<h2><span translate="sampleApplicationApp.label.detail.title">Label</span> {{vm.label.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="dl-horizontal jh-entity-details">
<dt><span translate="sampleApplicationApp.label.label">Label</span></dt>
<dd>

View File

@ -14,7 +14,9 @@
'get': {
method: 'GET',
transformResponse: function (data) {
data = angular.fromJson(data);
if (data) {
data = angular.fromJson(data);
}
return data;
}
},

View File

@ -2,6 +2,7 @@
<div>
<h2><span translate="sampleApplicationApp.operation.detail.title">Operation</span> {{vm.operation.id}}</h2>
<hr>
<jhi-alert-error></jhi-alert-error>
<dl class="dl-horizontal jh-entity-details">
<dt><span translate="sampleApplicationApp.operation.date">Date</span></dt>
<dd>

View File

@ -14,8 +14,10 @@
'get': {
method: 'GET',
transformResponse: function (data) {
data = angular.fromJson(data);
data.date = DateUtils.convertDateTimeFromServer(data.date);
if (data) {
data = angular.fromJson(data);
data.date = DateUtils.convertDateTimeFromServer(data.date);
}
return data;
}
},

View File

@ -18,7 +18,7 @@
return service;
function getProfileInfo() {
if (!angular.isDefined(dataPromise)) {
if (angular.isUndefined(dataPromise)) {
dataPromise = $http.get('api/profile-info').then(function(result) {
if (result.data.activeProfiles) {
var response = {};

View File

@ -115,6 +115,7 @@
},
"error": {
"server.not.reachable": "Server not reachable",
"url.not.found": "Not found",
"NotNull": "Field {{ fieldName }} cannot be empty!",
"Size": "Field {{ fieldName }} does not meet min/max size requirements!",
"userexists": "Login name already used!",

View File

@ -3,11 +3,12 @@
describe('Controller Tests', function () {
describe('JhiHealthCheckController', function () {
var $scope; // actual implementations
var $scope, jhiHealthService; // actual implementations
var createController; // local utility functions
beforeEach(inject(function ($injector) {
beforeEach(inject(function ($injector, JhiHealthService) {
$scope = $injector.get('$rootScope').$new();
jhiHealthService = JhiHealthService;
var locals = {
'$scope': $scope
};
@ -17,49 +18,31 @@ describe('Controller Tests', function () {
createController();
}));
describe('isHealthObject and hasSubSystem', function () {
it('should verify empty object is not a health property leaf', function () {
expect($scope.vm.isHealthObject({})).toBe(false);
expect($scope.vm.hasSubSystem({})).toBe(false);
describe('baseName and subSystemName', function () {
it('should return the basename when it has no sub system', function () {
expect($scope.vm.baseName('base')).toBe('base');
});
it('should verify object with property status and no subsystems is a health property leaf', function () {
var healthObject = {
'status': 'UP'
};
expect($scope.vm.isHealthObject(healthObject)).toBe(true);
expect($scope.vm.hasSubSystem(healthObject)).toBe(false);
it('should return the basename when it has sub systems', function () {
expect($scope.vm.baseName('base.subsystem.system')).toBe('base');
});
it('should verify that object property status and unrecognized objects is a health property leaf', function () {
var healthObject = {
'status': 'UP',
'subsystem': {
'hello': 'UP'
}
};
expect($scope.vm.isHealthObject(healthObject)).toBe(true);
expect($scope.vm.hasSubSystem(healthObject)).toBe(false);
it('should return the sub system name', function () {
expect($scope.vm.subSystemName('subsystem')).toBe('');
});
it('should verify object with property status but with subsystems is NOT a health property leaf', function () {
var healthObject = {
'status': 'UP',
'subsystem': {
'status': 'UP'
}
};
expect($scope.vm.isHealthObject(healthObject)).toBe(true);
expect($scope.vm.hasSubSystem(healthObject)).toBe(true);
it('should return the subsystem when it has multiple keys', function () {
expect($scope.vm.subSystemName('subsystem.subsystem.system')).toBe(' - subsystem.system');
});
});
describe('transformHealthData', function () {
it('should flatten empty health data', function () {
var data = {};
var expected = [];
expect($scope.vm.transformHealthData(data)).toEqual(expected);
expect(jhiHealthService.transformHealthData(data)).toEqual(expected);
});
it('should flatten health data with no subsystems', function () {
@ -90,7 +73,7 @@ describe('Controller Tests', function () {
'error': 'mail.a.b.c'
}
];
expect($scope.vm.transformHealthData(data)).toEqual(expected);
expect(jhiHealthService.transformHealthData(data)).toEqual(expected);
});
it('should flatten health data with subsystems at level 1, main system has no additional information', function () {
@ -148,7 +131,7 @@ describe('Controller Tests', function () {
}
}
];
expect($scope.vm.transformHealthData(data)).toEqual(expected);
expect(jhiHealthService.transformHealthData(data)).toEqual(expected);
});
it('should flatten health data with subsystems at level 1, main system has additional information', function () {
@ -214,7 +197,7 @@ describe('Controller Tests', function () {
}
}
];
expect($scope.vm.transformHealthData(data)).toEqual(expected);
expect(jhiHealthService.transformHealthData(data)).toEqual(expected);
});
it('should flatten health data with subsystems at level 1, main system has additional error', function () {
@ -278,29 +261,9 @@ describe('Controller Tests', function () {
}
}
];
expect($scope.vm.transformHealthData(data)).toEqual(expected);
expect(jhiHealthService.transformHealthData(data)).toEqual(expected);
});
});
describe('getModuleName(path, name)', function () {
it('should show both path and name if defined', function () {
expect($scope.vm.getModuleName('path', 'name')).toEqual('path' + $scope.vm.separator + 'name');
});
it('should show only path if name is not defined', function () {
expect($scope.vm.getModuleName('path')).toEqual('path');
expect($scope.vm.getModuleName('path', '')).toEqual('path');
expect($scope.vm.getModuleName('path', null)).toEqual('path');
});
it('should show only name if path is not defined', function () {
expect($scope.vm.getModuleName(null, 'name')).toEqual('name');
expect($scope.vm.getModuleName('', 'name')).toEqual('name');
});
it('should show empty string if neither name nor path is defined', function () {
expect($scope.vm.getModuleName()).toEqual('');
});
});
});
});