NSAmelchev commented on PR #13683:
URL: https://github.com/apache/ignite/pull/13683#issuecomment-6195599558
LGTM overall. One suggestion: the test can be simplified — once the
`IllegalArgumentException` with the expected message is asserted, the request
never reached the exchange, so the failure handler and
`checkClusterOperational()` add no coverage, and one server is enough. Sketch
(fails without the fix, ~6 s):
```java
public class CacheGroupNameValidationTest extends GridCommonAbstractTest {
/** */
private static final String ERR_MSG = "Cache group name must not be
empty.";
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
}
/** */
@Test
public void testCreateCache() throws Exception {
IgniteEx srv = startGrid(0);
assertThrowsAnyCause(log, () -> srv.createCache(new
CacheConfiguration<>("cache1").setGroupName("")),
IllegalArgumentException.class, ERR_MSG);
}
/** */
@Test
public void testThinClientCreateCache() throws Exception {
startGrid(0);
try (IgniteClient cli = Ignition.startClient(new
ClientConfiguration().setAddresses("127.0.0.1:10800"))) {
Throwable e = assertThrowsWithCause(
() -> cli.createCache(new
ClientCacheConfiguration().setName("cache1").setGroupName("")),
ClientException.class);
assertTrue(e.getMessage(), e.getMessage().contains(ERR_MSG));
}
}
/** */
@Test
public void testStaticConfiguration() throws Exception {
startGrid(0);
assertThrowsAnyCause(log, () ->
startGrid(getConfiguration(getTestIgniteInstanceName(1))
.setCacheConfiguration(new
CacheConfiguration<>("cache1").setGroupName(""))),
IllegalArgumentException.class, ERR_MSG);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]