Move example plugin out of core
Summary: We should not ship this as part of our distribution. Just meant we had to bifurcate our unit tests which is a bit awkward, but it works now. Reviewed By: jknoxville Differential Revision: D15146980 fbshipit-source-id: 496b000630bbfcaa663cddacb00550e1499a1279
This commit is contained in:
committed by
Facebook Github Bot
parent
821408056f
commit
b7fff23700
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
package com.facebook.flipper.plugins.example;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
|
||||
import com.facebook.flipper.core.FlipperObject;
|
||||
import com.facebook.flipper.testing.FlipperConnectionMock;
|
||||
import com.facebook.flipper.testing.FlipperResponderMock;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class ExampleFlipperPluginTest {
|
||||
|
||||
@Test
|
||||
public void greetingTest() throws Exception {
|
||||
final ExampleFlipperPlugin plugin = new ExampleFlipperPlugin();
|
||||
final FlipperConnectionMock connection = new FlipperConnectionMock();
|
||||
final FlipperResponderMock responder = new FlipperResponderMock();
|
||||
|
||||
plugin.onConnect(connection);
|
||||
connection
|
||||
.receivers
|
||||
.get("displayMessage")
|
||||
.onReceive(new FlipperObject.Builder().put("message", "test").build(), responder);
|
||||
|
||||
assertThat(
|
||||
responder.successes, hasItem(new FlipperObject.Builder().put("greeting", "Hello").build()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user