blob: 63be613e530fb459090561b383e3db8754d6a4d8 [file] [log] [blame]
/*
* Copyright 2016 Cisco Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
*/
package com.cisco.gerrit.plugins.slack.message;
import org.junit.Test;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
public class MessageGeneratorTest
{
@Test
public void testEscape() throws Exception
{
MessageGenerator messageGenerator;
messageGenerator = new MessageGenerator()
{
@Override
public boolean shouldPublish()
{
return false;
}
@Override
public String generate()
{
return null;
}
};
assertThat(messageGenerator.escape("\""), is(equalTo("\\\"")));
}
}