Skip to content

Commit

Permalink
add unit test for ServiceChangeEvent (#5714)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xiao-shuang authored May 17, 2021
1 parent 1974cf0 commit 2bc782e
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 1999-2020 Alibaba Group Holding Ltd.
*
* 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.alibaba.nacos.naming.push.v1;

import com.alibaba.nacos.naming.core.Service;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class ServiceChangeEventTest {

@Mock
private Service service;

@Mock
private Object object;

@Test
public void testGetService() {
ServiceChangeEvent serviceChangeEvent = new ServiceChangeEvent(object, service);
Service service = serviceChangeEvent.getService();

Assert.assertNotNull(service);
Assert.assertEquals(service, service);
}
}

0 comments on commit 2bc782e

Please sign in to comment.