Skip to content

Commit f6a3fd1

Browse files
author
eugenp
committed
cleanup work
1 parent d1ebdd8 commit f6a3fd1

5 files changed

Lines changed: 13 additions & 18 deletions

File tree

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
<dependency>
247247
<groupId>com.jayway.restassured</groupId>
248248
<artifactId>rest-assured</artifactId>
249-
<version>1.5</version>
249+
<version>1.6</version>
250250
<scope>test</scope>
251251
<exclusions>
252252
<exclusion>

‎src/main/java/org/rest/sec/persistence/setup/SecuritySetup.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public final void onApplicationEvent(final ContextRefreshedEvent event) {
6060
createPrincipals();
6161

6262
setupDone = true;
63+
logger.info("Setup Done");
6364
}
6465
}
6566

‎src/test/java/org/rest/client/template/AbstractRESTTemplate.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import com.jayway.restassured.response.Response;
1717

1818
/**
19-
* Template for the consumption of the REST API <br>
19+
* REST Template for the consumption of the REST API <br>
2020
*/
2121
public abstract class AbstractRESTTemplate<T extends IEntity> implements IRESTTemplate<T> {
2222
protected final Logger logger = LoggerFactory.getLogger(getClass());
@@ -181,4 +181,4 @@ public final IMarshaller getMarshaller() {
181181
return marshaller;
182182
}
183183

184-
}
184+
}

‎src/test/java/org/rest/persistence/AbstractPersistenceServiceIntegrationTest.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.rest.persistence.service.IService;
1616
import org.rest.util.IDUtils;
1717
import org.springframework.dao.DataAccessException;
18-
import org.springframework.test.annotation.Rollback;
1918

2019
public abstract class AbstractPersistenceServiceIntegrationTest<T extends IEntity> {
2120

@@ -94,7 +93,6 @@ public void whenNullEntityIsCreated_thenException() {
9493
}
9594

9695
@Test
97-
@Rollback
9896
public void whenEntityIsCreated_thenNoExceptions() {
9997
getAPI().create(createNewEntity());
10098
}
@@ -177,7 +175,7 @@ public void givenEntityDoesNotExists_whenEntityIsDeleted_thenDataAccessException
177175
@Test(expected = DataAccessException.class)
178176
public void whenEntityIsDeletedByNegativeId_thenDataAccessException() {
179177
// When
180-
getAPI().delete((IDUtils.randomNegativeLong()));
178+
getAPI().delete(IDUtils.randomNegativeLong());
181179
}
182180

183181
@Test

‎src/test/java/org/rest/sec/persistence/service/PrincipalServicePersistenceIntegrationTest.java‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
@ContextConfiguration(classes = { TestingConfig.class, PersistenceJPAConfig.class, ContextTestConfig.class }, loader = AnnotationConfigContextLoader.class)
2424
public class PrincipalServicePersistenceIntegrationTest extends AbstractPersistenceServiceIntegrationTest<Principal> {
2525

26-
@Autowired
27-
IPrivilegeService privilegeService;
28-
@Autowired
29-
IRoleService roleService;
3026
@Autowired
3127
private IPrincipalService principalService;
3228

@@ -45,32 +41,32 @@ public void whenAUniqueConstraintIsBroken_thenSpringSpecificExceptionIsThrown()
4541
getAPI().create(createNewEntity(name));
4642
}
4743

48-
// Spring
44+
// template method
4945

5046
@Override
5147
protected final IService<Principal> getAPI() {
5248
return principalService;
5349
}
5450

55-
// template method
56-
5751
@Override
5852
protected final Principal createNewEntity() {
5953
return new Principal(randomAlphabetic(8), randomAlphabetic(8), Sets.<Role> newHashSet());
6054
}
6155

62-
protected final Principal createNewEntity(final String name) {
63-
return new Principal(name, randomAlphabetic(8), Sets.<Role> newHashSet());
64-
}
65-
6656
@Override
6757
protected final void invalidate(final Principal entity) {
6858
entity.setName(null);
6959
}
7060

7161
@Override
72-
protected void changeEntity(final Principal entity) {
62+
protected final void changeEntity(final Principal entity) {
7363
entity.setPassword(randomAlphabetic(8));
7464
}
7565

66+
//
67+
68+
protected final Principal createNewEntity(final String name) {
69+
return new Principal(name, randomAlphabetic(8), Sets.<Role> newHashSet());
70+
}
71+
7672
}

0 commit comments

Comments
 (0)