NEW YORK — Home diva Martha Stewart testified in court Tuesday that she did nothing wrong when she signed an agreement to open up shops within most of the J.C. Penney stores across the country.

Stewart testified in New York State Supreme Court as part of a legal battle over whether the company that she founded breached its contract to sell cookware, bedding and other items exclusively at Macy’s when she signed the deal with Penney in 2011.

Stewart, who founded Martha Stewart Living Omnimedia Inc., denied Macy’s allegations that she did anything unethical in brokering the deal with Penney. During the three hours of testimony, Stewart said she was only looking to expand and offer new opportunities for shoppers.

Stewart said it was Macy’s that didn’t uphold the agreement to try to maximize the potential of her business. She said her brand, which does about $300 million in sales at Macy’s, has grown “static.” Stewart said she was hoping the business would exceed well over $400 million.

The trial began Feb. 20.

Penney signed a pact in December 2011 with Martha Stewart Living to open shops at most of its 1,100 stores by this spring. One month later, Macy’s renewed its long-standing exclusive deal until 2018 and sued Martha Stewart Living and Penney.

Martha Stewart and Penney are using a provision in the agreement with Macy’sthat allows Stewart to sell goods in categories like bedding in Martha Stewart stores.

Martha Stewart lawyers said, the Macy’s agreement doesn’t specify these stores have to be “stand alone,” so the mini shops within Penney stores do not fall under the exclusive agreement.