Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2022 Google LLC
//
// 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.google.api.generator.spring.composer;

import com.google.api.generator.gapic.composer.common.TestProtoLoader;
import com.google.api.generator.gapic.model.GapicClass;
import com.google.api.generator.gapic.model.GapicContext;
import com.google.api.generator.gapic.model.Service;
import com.google.api.generator.test.framework.Assert;
import org.junit.Before;
import org.junit.Test;

public class SpringAutoConfigClassComposerTest {
private GapicContext context;
private Service echoProtoService;

@Before
public void setUp() {
this.context = TestProtoLoader.instance().parseShowcaseEcho();
this.echoProtoService = this.context.services().get(0);
}

@Test
public void generateAutoConfigClazzTest() {
GapicClass clazz =
SpringAutoConfigClassComposer.instance().generate(this.context, this.echoProtoService);
String fileName = clazz.classDefinition().classIdentifier() + ".golden";
Assert.assertGoldenClass(this.getClass(), clazz, fileName);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2022 Google LLC
//
// 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.google.api.generator.spring.composer;

import com.google.api.generator.gapic.composer.common.TestProtoLoader;
import com.google.api.generator.gapic.model.GapicClass;
import com.google.api.generator.gapic.model.GapicContext;
import com.google.api.generator.test.framework.Assert;
import java.util.List;
import org.junit.Before;
import org.junit.Test;

public class SpringComposerTest {
private GapicContext context;

@Before
public void setUp() {
this.context = TestProtoLoader.instance().parseShowcaseEcho();
}

@Test
public void spring_composer_test() {

List<GapicClass> gapicClasses = SpringComposer.composeServiceAutoConfigClasses(context);

// write to verify result for now
for (GapicClass gapicClazz : gapicClasses) {
String fileName = gapicClazz.classDefinition().classIdentifier() + "Full.golden";
Assert.assertGoldenClass(this.getClass(), gapicClazz, fileName);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2022 Google LLC
//
// 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.google.api.generator.spring.composer;

import com.google.api.generator.gapic.composer.common.TestProtoLoader;
import com.google.api.generator.gapic.model.GapicClass;
import com.google.api.generator.gapic.model.GapicContext;
import com.google.api.generator.gapic.model.Service;
import com.google.api.generator.test.framework.Assert;
import org.junit.Before;
import org.junit.Test;

public class SpringPropertiesClassComposerTest {
private GapicContext context;
private Service echoProtoService;

@Before
public void setUp() {
this.context = TestProtoLoader.instance().parseShowcaseEcho();
this.echoProtoService = this.context.services().get(0);
}

@Test
public void generateAutoConfigClazzTest() {
GapicClass clazz =
SpringPropertiesClassComposer.instance().generate(this.context, this.echoProtoService);
String fileName = clazz.classDefinition().classIdentifier() + ".golden";
Assert.assertGoldenClass(this.getClass(), clazz, fileName);
}
}
Loading