Skip to content

Commit

Permalink
apache#2748: Provider should disable mock configuration (apache#2749)
Browse files Browse the repository at this point in the history
  • Loading branch information
beiwei30 authored and CrazyHZM committed Dec 6, 2018
1 parent a27347f commit 9d072a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,16 @@ public void setGeneric(String generic) {
}
}

@Override
public void setMock(Boolean mock) {
throw new IllegalArgumentException("mock doesn't support on provider side");
}

@Override
public void setMock(String mock) {
throw new IllegalArgumentException("mock doesn't support on provider side");
}

public List<URL> getExportedUrls() {
return urls;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ public void testGeneric2() throws Exception {
service.setGeneric("illegal");
}

@Test(expected = IllegalArgumentException.class)
public void testMock() throws Exception {
ServiceConfig service = new ServiceConfig();
service.setMock("true");
}

@Test(expected = IllegalArgumentException.class)
public void testMock2() throws Exception {
ServiceConfig service = new ServiceConfig();
service.setMock(true);
}

@Test
public void testUniqueServiceName() throws Exception {
ServiceConfig<Greeting> service = new ServiceConfig<Greeting>();
Expand Down

0 comments on commit 9d072a1

Please sign in to comment.