// Test that existing shared_read partition with new shared_write coalesces to
// shared_write
@Test
public void testSRSWPart() {
LockRequestBuilder bldr = new LockRequestBuilder();
LockComponent comp = new LockComponent(LockType.SHARED_READ, LockLevel.DB, "mydb");
comp.setTablename("mytable");
comp.setPartitionname("mypart");
bldr.addLockComponent(comp);
comp = new LockComponent(LockType.SHARED_WRITE, LockLevel.DB, "mydb");
comp.setTablename("mytable");
comp.setPartitionname("mypart");
bldr.addLockComponent(comp).setUser("fred");
LockRequest req = bldr.build();
List<LockComponent> locks = req.getComponent();
Assert.assertEquals(1, locks.size());
Assert.assertEquals(LockType.SHARED_WRITE, locks.get(0).getType());