Skip to content

Commit

Permalink
optimize spring autoconfigure server unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
l81893521 committed Dec 30, 2023
1 parent 7860680 commit 3ea9016
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ public void testStoreProperties() {
storeProperties.setMode("mode");
storeProperties.setPublicKey("public");

StoreProperties.Session session = new StoreProperties.Session();
session.setMode("mode");

StoreProperties.Lock lock = new StoreProperties.Lock();
lock.setMode("mode");

Assertions.assertEquals("mode", storeProperties.getMode());
Assertions.assertEquals("public", storeProperties.getPublicKey());
Assertions.assertEquals("mode", session.getMode());
Assertions.assertEquals("mode", lock.getMode());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,19 @@ public void testStoreRedisProperties() {
Assertions.assertEquals(1, storeRedisProperties.getMinConn());
Assertions.assertEquals(1, storeRedisProperties.getQueryLimit());
Assertions.assertEquals(1, storeRedisProperties.getMaxTotal());

StoreRedisProperties.Single single = new StoreRedisProperties.Single();
single.setHost("host");
single.setPort(80);
Assertions.assertEquals("host", single.getHost());
Assertions.assertEquals(80, single.getPort());

StoreRedisProperties.Sentinel sentinel = new StoreRedisProperties.Sentinel();
sentinel.setSentinelHosts("host");
sentinel.setMasterName("master");
sentinel.setSentinelPassword("pwd");
Assertions.assertEquals("host", sentinel.getSentinelHosts());
Assertions.assertEquals("master", sentinel.getMasterName());
Assertions.assertEquals("pwd", sentinel.getSentinelPassword());
}
}

0 comments on commit 3ea9016

Please sign in to comment.