1
0

accessrights.jdl: UserRoleAssignments entity*Id required

This commit is contained in:
Michael Hoennig
2019-05-07 12:54:39 +02:00
parent 6df2cbce0b
commit bac012f9b4
33 changed files with 298 additions and 222 deletions

View File

@ -53,8 +53,8 @@ public class CustomerResourceIntTest {
private static final Integer DEFAULT_REFERENCE = 10000;
private static final Integer UPDATED_REFERENCE = 10001;
private static final String DEFAULT_PREFIX = "z4a";
private static final String UPDATED_PREFIX = "dr";
private static final String DEFAULT_PREFIX = "y5j";
private static final String UPDATED_PREFIX = "f0u";
private static final String DEFAULT_NAME = "AAAAAAAAAA";
private static final String UPDATED_NAME = "BBBBBBBBBB";

View File

@ -156,6 +156,44 @@ public class UserRoleAssignmentResourceIntTest {
assertThat(userRoleAssignmentList).hasSize(databaseSizeBeforeCreate);
}
@Test
@Transactional
public void checkEntityTypeIdIsRequired() throws Exception {
int databaseSizeBeforeTest = userRoleAssignmentRepository.findAll().size();
// set the field null
userRoleAssignment.setEntityTypeId(null);
// Create the UserRoleAssignment, which fails.
restUserRoleAssignmentMockMvc.perform(
post("/api/user-role-assignments")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(userRoleAssignment)))
.andExpect(status().isBadRequest());
List<UserRoleAssignment> userRoleAssignmentList = userRoleAssignmentRepository.findAll();
assertThat(userRoleAssignmentList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkEntityObjectIdIsRequired() throws Exception {
int databaseSizeBeforeTest = userRoleAssignmentRepository.findAll().size();
// set the field null
userRoleAssignment.setEntityObjectId(null);
// Create the UserRoleAssignment, which fails.
restUserRoleAssignmentMockMvc.perform(
post("/api/user-role-assignments")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
.content(TestUtil.convertObjectToJsonBytes(userRoleAssignment)))
.andExpect(status().isBadRequest());
List<UserRoleAssignment> userRoleAssignmentList = userRoleAssignmentRepository.findAll();
assertThat(userRoleAssignmentList).hasSize(databaseSizeBeforeTest);
}
@Test
@Transactional
public void checkAssignedRoleIsRequired() throws Exception {

View File

@ -28,33 +28,39 @@ describe('Component Tests', () => {
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new Asset(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.asset = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call update service on save for existing entity',
fakeAsync(() => {
// GIVEN
const entity = new Asset(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.asset = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new Asset();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.asset = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call create service on save for new entity',
fakeAsync(() => {
// GIVEN
const entity = new Asset();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.asset = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
});
});
});

View File

@ -28,33 +28,39 @@ describe('Component Tests', () => {
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new Customer(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.customer = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call update service on save for existing entity',
fakeAsync(() => {
// GIVEN
const entity = new Customer(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.customer = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new Customer();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.customer = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call create service on save for new entity',
fakeAsync(() => {
// GIVEN
const entity = new Customer();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.customer = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
});
});
});

View File

@ -28,33 +28,39 @@ describe('Component Tests', () => {
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new Membership(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.membership = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call update service on save for existing entity',
fakeAsync(() => {
// GIVEN
const entity = new Membership(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.membership = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new Membership();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.membership = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call create service on save for new entity',
fakeAsync(() => {
// GIVEN
const entity = new Membership();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.membership = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
});
});
});

View File

@ -28,33 +28,39 @@ describe('Component Tests', () => {
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new SepaMandate(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.sepaMandate = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call update service on save for existing entity',
fakeAsync(() => {
// GIVEN
const entity = new SepaMandate(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.sepaMandate = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new SepaMandate();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.sepaMandate = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call create service on save for new entity',
fakeAsync(() => {
// GIVEN
const entity = new SepaMandate();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.sepaMandate = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
});
});
});

View File

@ -28,33 +28,39 @@ describe('Component Tests', () => {
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new Share(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.share = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call update service on save for existing entity',
fakeAsync(() => {
// GIVEN
const entity = new Share(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.share = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new Share();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.share = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call create service on save for new entity',
fakeAsync(() => {
// GIVEN
const entity = new Share();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.share = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
});
});
});

View File

@ -28,33 +28,39 @@ describe('Component Tests', () => {
});
describe('save', () => {
it('Should call update service on save for existing entity', fakeAsync(() => {
// GIVEN
const entity = new UserRoleAssignment(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.userRoleAssignment = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call update service on save for existing entity',
fakeAsync(() => {
// GIVEN
const entity = new UserRoleAssignment(123);
spyOn(service, 'update').and.returnValue(of(new HttpResponse({ body: entity })));
comp.userRoleAssignment = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.update).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
it('Should call create service on save for new entity', fakeAsync(() => {
// GIVEN
const entity = new UserRoleAssignment();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.userRoleAssignment = entity;
// WHEN
comp.save();
tick(); // simulate async
it(
'Should call create service on save for new entity',
fakeAsync(() => {
// GIVEN
const entity = new UserRoleAssignment();
spyOn(service, 'create').and.returnValue(of(new HttpResponse({ body: entity })));
comp.userRoleAssignment = entity;
// WHEN
comp.save();
tick(); // simulate async
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
}));
// THEN
expect(service.create).toHaveBeenCalledWith(entity);
expect(comp.isSaving).toEqual(false);
})
);
});
});
});