expectConfigurationRequests( 7 );
archivaConfigurationControl.replay();
// Prepare Test.
action.prepare();
ProxyConnector connector = action.getConnector();
populateProxyConnector( connector );
// Add some arbitrary properties.
connector.addProperty( "username", "general-tso" );
connector.addProperty( "password", "chicken" );
// Perform Test w/no property key.
preRequest( action );
String status = action.removeProperty();
assertEquals( Action.INPUT, status );
// Should have returned an error, with no properties removed.
assertHasErrors( action );
assertEquals( 2, connector.getProperties().size() );
// Perform test w/invalid (non-existant) property key to remove.
preRequest( action );
action.setPropertyKey( "slurm" );
status = action.removeProperty();
assertEquals( Action.INPUT, status );
// Should have returned an error, with no properties removed.
assertHasErrors( action );
assertEquals( 2, connector.getProperties().size() );
// Try again, but now with a valid property to remove.
preRequest( action );
action.setPropertyKey( "password" );
status = action.removeProperty();
assertEquals( Action.INPUT, status );
// Should have no error, and 1 property left.
assertNoErrors( action );
assertEquals( 1, connector.getProperties().size() );
assertEquals( "Should have left 1 property", "general-tso", connector.getProperties().get( "username" ) );
}