Change AccountSession to use lombok features

- Change AccountSession to use lombok @Data annotation
- Make UUID and created final

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-01-23 11:05:10 +01:00
committed by Adam
parent c157c0df75
commit 8d81e82177
3 changed files with 12 additions and 82 deletions

View File

@@ -68,10 +68,8 @@ public class ConfigManagerTest
@Test
public void testGetConfig() throws IOException
{
AccountSession accountSession = new AccountSession();
accountSession.setUuid(UUID.randomUUID());
AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now());
accountSession.setUsername("test");
accountSession.setCreated(Instant.now());
manager.setConfiguration("test", "key", "moo");
@@ -82,10 +80,8 @@ public class ConfigManagerTest
@Test
public void testGetConfigDefault() throws IOException
{
AccountSession accountSession = new AccountSession();
accountSession.setUuid(UUID.randomUUID());
AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now());
accountSession.setUsername("test");
accountSession.setCreated(Instant.now());
TestConfig conf = manager.getConfig(TestConfig.class);
Assert.assertEquals("default", conf.key());
@@ -94,10 +90,8 @@ public class ConfigManagerTest
@Test
public void testSetConfig() throws IOException
{
AccountSession accountSession = new AccountSession();
accountSession.setUuid(UUID.randomUUID());
AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now());
accountSession.setUsername("test");
accountSession.setCreated(Instant.now());
TestConfig conf = manager.getConfig(TestConfig.class);
conf.key("new value");
@@ -108,10 +102,8 @@ public class ConfigManagerTest
@Test
public void testGetConfigDescriptor() throws IOException
{
AccountSession accountSession = new AccountSession();
accountSession.setUuid(UUID.randomUUID());
AccountSession accountSession = new AccountSession(UUID.randomUUID(), Instant.now());
accountSession.setUsername("test");
accountSession.setCreated(Instant.now());
TestConfig conf = manager.getConfig(TestConfig.class);
ConfigDescriptor descriptor = manager.getConfigDescriptor(conf);